The fediverso is connected by protocols like ActivityPub and WebFinger that I know very little about at this time. This is because the Steampipe plugin, which is compatible with the boards I’ve been creating and describing in this series, doesn’t require you to understand or use those protocols.
However, it requires you to understand and use the Mastodon API. I mostly use that API via the Go SDK for Mastodon (thanks mattn!), sometimes I make REST calls directly. Either way, my read-only boards use a fairly small subset of the Mastodon API. The full API is quite broad and deep; allows API clients to read and write to Mastodon servers in many ways. These are the chapters of the Mastodon API book: applications, accounts, administration, instance, search, states, timelines, notifications, oembed. These chapters define what is common to all Mastodon clients, including web apps, phone apps, native OS apps, and Steampipe dashboards.
So far, I’ve ignored protocol-enabled interop to focus on API-enabled interop. I am aware that the fediverse includes much more than just Mastodon. I intend to explore BookWrym, Friendica, Funkwhale, Lemmy, takahe, PeerTube, Pixelfed, PeerTube and others in due course. But right now, the Mastodon ecosystem is enough to try to figure it out.
For example, there is a new web client for Mastodon: elk.zone. With the recent addition of list support, it has become my favorite way to interact in the Mastodon space. So naturally I wanted to be able to click from panels from Steampipe to Elk, and use it as an alternative to the Mastodon web app with batteries included.
It was easy to enable that integration. Not thanks to ActivityPub, and not even thanks to the API. It works because of a third level of interop at play: common patterns for account URLs and toot URLs.
This is the URL of Ward Cunningham’s account, who posts his tile at mastodon.radio: https://mastodon.radio/@k9ox. But as we saw in instance-qualified Mastodon URLs, if you visit that URL directly, and if it’s not your main server, you can’t follow Ward there or add him to a list. You’ll need to copy that URL, paste it into your home server’s search box, run the search, and arrive at an instance-qualified URL where you can follow or add to a list: https://mastodon.social/ @k9ox@mastodon.radio . If your home is fosstodon.org, this would be https://fosstodon.org/@k9ox@mastodon.radio.
Similarly, here is one of Ward’s touches on mastodon.radio: https://mastodon.radio/@k9ox/109802968820955379. If you want to reply, boost, or bookmark, you can’t do it there. The URL you need is again one that is routed through your home server: https://mastodon.social/@k9ox@mastodon.radio/109802969999396562. Note that the IDs for the same toot differ! That difference surprised me and a few others, and is a topic for another episode. I’ll just point out here that these two patterns govern how we interact when we cross server boundaries in the Mastodon space using the standard web client.
When I started using Elk, another pattern layer emerged. Here are those same URLs in Elk:
https://elk.zone/mastodon.social/@k9ox@mastodon.radio
https://elk.zone/mastodon.social/@k9ox@mastodon.radio/109802969999396562
Turns out I just needed to make two of the Steampipe plugin’s transform functions prepend elk.zone to the instance-qualified URLs, then make the prefix a configuration option. Now when I visit the Mastodon links from the dashboards, to reply, boost, follow or sign up, I land on the Elk experience I prefer.
ActivityPub and WebFinger are formal standards. I would describe the Mastodon API as a de facto standard. But this prefix maneuver is just a convention. It is not guaranteed to work with any other web client, and is not even guaranteed to work on all URLs presented by the standard Mastodon client. That’s fine by me. Conventions are incredibly useful. The Twitter hashtag is just a convention, after all, itself inspired by an IRC convention.
We are in one of those times of rapid innovation on the Internet, when new conventions can unlock emerging behaviors. It hadn’t even occurred to me that Steampipe boards might support Elk. A few hours after I thought they might do it, they did. I’ve seen this sort of thing before, perhaps most notably when the blogosphere embraced <link rel="alternate" type="application/rss+xml" href="https://www.infoworld.com/article/3687637/{feedUrl}">
to allow browsers to automatically discover RSS feeds. That happened about 20 years ago, and suddenly, when a handful of leading blogging tools adopted the convention in a matter of days. It was a lot of fun living that time. If you missed it, please enjoy the sequel that is in development now!
These series:
- Autonomy, pack size, friction, fanout and speed
- Create a Mastodon panel with Steampipe
- Navigating the fediverse
- A Bloomberg terminal for Mastodon
- Create your own Mastodon UX
- Lists and people on Mastodon
- How many people on my Mastodon feed also tweeted today?
- Qualified Mastodon URLs per instance
- Mastodon Ratio Charts
- Working with Mastodon lists
- Images considered harmful (sometimes)
- Mapping the broader fediverse
- Protocols, APIs and conventions
Copyright © 2023 IDG Communications, Inc.
Be First to Comment