Mastodon to Blog Archive script

Tantek Çelik blogged about Mastodon’s account migration and its post export, which is based on ActivityStreams. No other apps really import this format yet, not even Mastodon itself. He also mentions the Blog Archive Format and how useful it would be to convert between Mastodon and this format:

Such a library would make an excellent drop-in addition to any #ActivityPub implementation, allowing both export of posts, and also a browsable archive format, so you could visually double check when importing to another service that these were the old posts you were looking for.

I’ve taken a first pass at writing a Ruby script to convert Mastodon’s export to Blog Archive Format. It’s available as a GitHub Gist here. It’s not packaged as a general-purpose library but certainly could be adapted for that.

Direct posts import from Mastodon will be baked into soon. We already support several formats — WordPress, Medium, Tumblr, Ghost — and I learned a lot about how best to process large archives while building the new Twitter import.

✴️ Also on

Manton Reece @manton