Theme Switcher:

Creating a generic "Log-in with Mastodon" service

· 2 comments · 750 words · Viewed ~301 times.


A padlock engraved into a circuit board.

Let's say you have a website - your_website.tld - and you want people to log in to it using their Mastodon account. For a traditional social-media site like Twitter or Facebook, you would create an OAuth app on the service that you want. But there are hundreds of Mastodon servers. So you need to create a new app for each one. That sounds hard, but it isn't. Well… not too hard. Here's some c…

Continue reading →

Untappd to Mastodon - Updated!

· 450 words


A bottle of beer outside on a sunny day.

A few years ago, I wrote some code to post Untappd check-ins to Mastodon. I've recently updated it to also post a photo of the beer you're enjoying. First up, you'll need a file called config.py to hold all your API keys: instance = "https://mastodon.social" access_token = "…" write_access_token = "…" untappd_client_id = "…" untappd_client_secret = "…" Then a file called u…

Continue reading →

How far did my post go on the Fediverse?

· 3 comments · 1,150 words · Viewed ~2,870 times.


Cartoon of a tusked mastodon holding a phone.

I wrote a moderately popular post on Mastodon. Lots of people shared it. Is it possible to find out how many different ActivityPub servers it went to? Yes! As we all know, the Fediverse is one big chain mail. I don't mean that in a derogatory way. When I write a post, it appears on my server (called an "instance" in Mastodon-speak). Everyone on my instance can see my post. My instance looks …

Continue reading →

On The Fediverse, No One Knows You're A Liar

· 5 comments · 350 words · Viewed ~317 times.


Screenshot of the Mastodon interface. It claims the user has 97 million posts, follows 97 thousand people, and is followed by 97 billion accounts. It's join date is March 1997.

One of the reasons I'm still on the original Mastodon.social instance is that I am vain. I joined shortly after the project was announced and, as a consequence, I have a "joined" date of 2016 and a user ID of under 10,000. This doesn't make me an "elder statesman" and is rarely useful beyond bragging rights. If I moved to a different server, my "birthday" would be irrevocably lost 😢 But… what i…

Continue reading →

Some thoughts on Mastodon search

· 8 comments · 850 words · Viewed ~581 times.


Cartoon of a tusked mastodon holding a phone.

The latest version of Mastodon includes search functionality. It's early days, but seems to work pretty well. Here are some of the interesting things I found when using it. Search is complex - expectations I don't mean the act of searching a database - that's routine - but I mean it is socially complex. Lots of people left Twitter because it was too easy to search for them. For example, if…

Continue reading →

How do you decentralise emergency alerts?

· 5 comments · 750 words · Viewed ~546 times.


Cartoon of a tusked mastodon holding a phone.

Twitter's decision to hobble its API has meant that a number of useful alerting bots might no longer function. Your local subway might not be able to Tweet each morning about delays on the line, nor will a tornado warning be displayed as you scroll through photos of brunch, and forget about flood alerts between your memes. In one sense, this is sad. A set of useful public services are being cut…

Continue reading →

Posting Untappd Checkins to Mastodon (and other services)

· 2 comments · 700 words · Viewed ~205 times.


HTML source code of the page.

I'm a big fan of Untappd. It's a social drinking app which lets you check in to a beer and rate it. Look, we all need hobbies, mine is drinking cider. You can see a list of everything I've drunk over the 13 last years. Nearly 900 different pints! After checking in, the app automatically posts to Twitter. But who wants to prop up Alan's failing empire? Not me! So here's some quick code to…

Continue reading →

Snowflake IDs in Mastodon (and Unique IDs in the Fediverse more generally)

· 1 comment · 500 words · Viewed ~1,135 times.


Hundreds of snowflakes - each one unique and beautiful.

Computer Science has two canonical "hard problems": cache invalidation naming things off-by-one errors Let's talk about how we name unique items in Federated services - for example, posts on a social media service. If you have only one service, it's pretty easy. Every time a new entry is created in a database, give it a sequential number. This becomes a problem at scale. If you have…

Continue reading →

WebMentions, Privacy, and DDoS - Oh My!

· 16 comments · 700 words · Viewed ~412 times.


Crappy line drawing explaining the above.

Mastodon - the distributed social network - has two interesting challenges when it comes to how users share links. I'd like to discuss those issues and suggest a possible way forward. When you click on a link on my website which takes you to another website, your browser sends a Referer. This says to the other site "Hey, I came here using a link on shkspr.mobi". This is useful because it lets…

Continue reading →

Getting Started with Mastodon's Conversations API

· 1 comment · 1,550 words · Viewed ~1,219 times.


A threaded conversation. You can see the order in which people have replied to each other - and what posts they are referencing.

The social network service "Mastodon" allows people to publish posts. People can reply to those posts. Other people can reply to those replies - and so on. What does that look like in the API? Here's a quick guide to the concepts you need to know - and some code to help you visualise conversations. When you scroll through the website, you normally see a list of replies. It looks like this: …

Continue reading →

Twitter's archive doesn't have alt text - but Mastodon's does!

· 2 comments · 400 words


The Twitter logo drawn in circles.

Because I don't trust Alan, the Hyperprat who now runs Twitter, I decided to download my Twitter archive before setting my account to dormant. About a decade ago, I wrote about how the Twitter archive works and where it is deficient. Things have got better, but there are still annoying limitations. For example, Hannah Kolbeck - founder of the Alt Text Reminder Bot recently pointed out that…

Continue reading →