💾 Archived View for thrig.me › blog › 2023 › 03 › 04 › xkcd-colon-slash-slash.gmi captured on 2024-07-09 at 00:58:49. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-11-14)

-=-=-=-=-=-=-

xkcd://

and some weird little programs

Given

gemini://gemini.thebackupbox.net/~epoch/blog/fingering

I probably should talk about the xkcd:// thing. This form was invented by a past version of he who now types here, perhaps because it is shorter

    https://xkcd.com/356
    xkcd://356

by about ten whole characters, and, why not? Certainly XKCD is important enough to have its own protocol, even (especially) if certain individuals want to remove teapot from the HTTP spec. The // is perhaps not necessary; a shorter xkcd:356 might have been used. However, a large part of the creative intent was to share such links over IRC, so the "link" needs to look a bit like a link, or that I'm rationalizing randomly after the fact. Hence the // in there to make it look like a web-type URL. The form hasn't caused any comprehension problems, but then again I've only used it in IRC channels that are nerdy by the standard of being IRC channels, or more likely it's that folks who have no idea what I'm going on about have gotten good at ignoring me. Of course there is no standards body hashing out these details, it's just me making up stuff as I go along.

"Civilizations break down when there is a deterioration within the social order, an inability to respond to challenges... instead of variety and versatility, there is a deadening uniformity and un-inventiveness."
-- "Arnold Toynbee and the Crisis of the West". Marvin Perry. 1982.

Hmm. Anyways,

Minutiae, Glorious Minutiae

It turns out that certain browsers have trouble supporting such fanciful protocols, but I have not actually been much using browsers to open links for quite some time now,

    Author: Jeremy Mates <jmates@sial.org>
    Date:   Thu Feb 20 20:45:07 2003 +0000

        Import of out-of-cvs work.

     ow/ow | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

as I have a tool, or more correctly a swiss army chainsaw, ow, that takes inputs, turns them into urls, and sends them off to browsers, the clipboard, or here to standard output so you might get an idea of what is going on. wv is an alternative name for ow; it acts on file paths.

    $ ow -l xkcd 123
    https://xkcd.com/123
    $ ow -l xkcd://123
    https://xkcd.com/123
    $ ow -l ant
    gemini://warmedal.se/~antenna/
    $ ow -l g web search
    https://duckduckgo.com/html?q=web+search
    $ ow -l gse gemini search
    gemini://geminispace.info/search?gemini+search
    $ ow -l mansect 1 ls
    http://man.openbsd.org/man1/ls.1
    $ pwd
    /home/jmates/src/scripts
    $ wv -l
    https://thrig.me/src/scripts.git
    $ cd ~/var/gemini/thrig.me
    $ wv -l blog/2023/03/04/xkcd-colon-slash-slash.gmi
    gemini://thrig.me/blog/2023/03/04/xkcd-colon-slash-slash.gmi

The xkcd links are by default sent to a program, xkcd, which uses the XKCD API to download and display the given comic number, but they could also be sent to w3m, Firefox, or any command that accepts a URL and does something productive(?) with it.

https://xkcd.com/json.html

You probably do not want to use this code (ow.c, I mean, xkcd.go isn't too terrible) but rather to take the ideas and maybe write your own "open web" tool to wrangle URL with. The downside is the time wasted on the code, the upside the ability to remap URL as need be, easy support for new protocols, like, I don't know, gemini, and independence from any one browser program. ow was originally written for use with OmniWeb, for example, but URL could also be sent to diagnostic tools, other browsers, etc. It also probably helps to be a command line junkie; if not, these tools may make little sense.

The "command url" form gave rise to sgrax: one may want to turn "command url" into something like "echo url | newcommand" which is what sgrax does, or the opposite of xargs(1).

    $ grep copycat ~/.ow/browsers
    copycat sgrax copycat
    $ ow -o copycat cosmic ; echo ; xsel -o ; echo
    gemini://cosmic.voyage
    gemini://cosmic.voyage

copycat is yet another tool that puts text piped to it into the clipboard and sends it to standard out, mostly for use as a vi filter as I've never gotten used to using vim with X11 or using whatever key it has to do that and anyways I use vi not vim these days, or may have need to use copycat elsewhere on the CLI.

ow is an interactive program, which could be bad; an alternative would be to instead collect and collate resources via RSS and other means into a database or email or something and read things there instead of going out to them. I have not really much explored that route, and it would make sense if you want to collect readings for offline use, or to avoid the too frequent use of an interactive program--busy checking on things for updates is something I probably need to be more mindful of.

Even More Minutiae

ow was originally a Perl script, though was converted to a C program (with embedded Perl for some complicated bits I didn't feel like changing to C) because running a Perl script that needed to be fast on the 2009 macbook (RIP November 2022) with a spinny metal harddrive was unacceptably slow. Yes, more than 30 milliseconds is too slow.

I did start Microsoft Teams on that macbook. Once.

You Probably Should Have Stopped Reading Some Time Ago Now

Since teapot is already taken, perhaps gemini could have a standard redirect for "have a cozy cup of tea". On the other hand, this would bloat the protocol. Reality, yu so vexing.

tags #xkcd #finger #legacyweb #gemini