I recently managed to fix an issue with a water pump I use for our irrigation projects that someone else had put together for me.

The fix was round about. I did some web searching, found the culprit was likely a pressure switch, ended up swapping the whole pump out, rewiring it the same, and finding no flow happening. As it turns out, I found the issue was completely elsewhere, a faulty in line water flow switch.

For me, it’s hard to beat the satisfaction of fixing a machine or tool all with my own tools and methods.

The same for finding my own end arounds with web stuff. That DIY joy is the best stuff.

So here is the issue. I use Discourse for running the OEG Connect community site. Back when I started it in 2020, I used a little feature that allows you to publish what is typically a discussion topic as a stand alone page- a series of them I made as a users guide. It removes all of the Discourse interface, and looks like a regular web page- rather than the ‘/t’ in the url for topic it has ‘pub’ — see https://connect.oeglobal.org/pub/connect-guide.

A weird issue I found was when I go to edit, it takes a ton of searching/scrolling to find the original published content as a topic, which I can edit was the content owner.

My reflex came to view HTML source (like maybe 0.0001% of web users likely do), expecting the real URL was in there. Sure enough it is as a <link> tag in the header, a canonical link.

HTML source showing <link rel="canonical" href="https://connect.oeglobal.org/t/a-guide-to-oeg-connect/237" />

And sure enough that URL gets me directly to the source. So I can when needed, view source, find the link, click or copy/paste and be on my merry editing way.

But tick tick tick, my head goes, this is also a simple job for a browser bookmarklet– these are still some of the most useful things I use on a daily basis. And they are all just simple Javascript code, stuff I make by hand.

So I give you a magic link you can drag to your bookmark bar. For any web page, when activated, if there is no canonical link, you see an alert. If it does find one, it displays and asks you if you want to take a trip, with OK and cancel options.

If you prefer the very simple, Alan’s Brute Force Javascript, voila

This is really trivial on the scale of programming feats. And its likely not even elegant. But it works. For me. And I hashed it out myself. I am sure I could have gone the route most people go now to ask ChatGPT et al to spit out the code. I likely would have had to go back and forth several times, likely not saving any time over what it did to do it myself, trip through my own syntax goofs, and finally get it working.

But I get more satisfaction doing this myself. Even for this drably simple task, I’d rather DIY it.

Make your own tools. See what it does for you.


Multitool
Multitool flickr photo by cogdogblog shared under a Creative Commons (BY) license

If this kind of stuff has value, please support me by tossing a one time PayPal kibble or monthly on Patreon
Become a patron at Patreon!
Profile Picture for CogDog The Blog
An early 90s builder of web stuff and blogging Alan Levine barks at CogDogBlog.com on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person. And he is 100% into the Fediverse (or tells himself so) Tooting as @cogdog@cosocial.ca

Leave a Reply

Your email address will not be published. Required fields are marked *