Skip to content

twtxt: Simple, Decentralized Microblogging with status.lol

I set up an effortless sync between my status.lol updates and a twtxt feed, creating a bridge between IndieWeb tools and classic decentralized microblogging.

B♾️

ike the rest of the full [omg.lol suite](https://omg.lol), I love [status.lol](https://status.lol/brennan). It's become my go-to place for quick thoughts, updates, and micro-posts around once a day. *And* there's also an [easy-to-use API](https://api.omg.lol/) that I've [used before](https://dev.to/brennan/version-controlled-omglol-auto-syncing-your-indieweb-with-github-actions-22eh). So, what if they could be part of the broader decentralized web?

That's when I decided to set up a [twtxt feed](/twtxt.txt) that automatically syncs with my status.lol updates.

Now, before I begin getting into the technical details, you might be asking what twtxt even is in the first place? Good question. twtxt is a decentralised, minimalist microblogging service for hackers.

From their [GitHub README](https://github.com/buckket/twtxt):

So you want to get some thoughts out on the internet in a convenient and slick way while also following the gibberish of others? Instead of signing up at a closed and/or regulated microblogging platform, getting your status updates out with twtxt is as easy as putting them in a publicly accessible text file. The URL pointing to this file is your identity, your account. twtxt then tracks these text files, like a feedreader, and builds your unique timeline out of them, depending on which files you track. The format is simple, human readable, and integrates well with UNIX command line utilities.

tl;dr: twtxt is a CLI tool, as well as a format specification for self-hosted flat file based microblogging.

## Syncing

Now, I post once on status.lol, and it automatically appears on [social.lol](https://social.lol/brennan) where my IndieWeb friends follow me, my site, and [twtxt.txt](/twtxt.txt).

No extra work! There is no pesky cross-posting (the way I still cross-post with Buffer on other microblogging platforms, but that's something for another day).

Here is the process: at build time, Eleventy fetches my latest status updates from the omg.lol API and transforms each status from JSON to twtxt format. The timestamps are converted to ISO 8601 MST timezone, and the emoji and content are combined into a single message. All of this is then generated into the final `/twtxt.txt` file.

```javascript // In .eleventy.js eleventyConfig.addGlobalData("statuslog", async () => { let json = await EleventyFetch( "https://api.omg.lol/address/brennan/statuses/", { duration: "1h", type: "json" } ); return json.response.statuses.map(status => ({ timestamp: new Date(parseInt(status.created) * 1000) .toISOString().replace(/\.\d{3}Z$/, '-07:00'), content: `${status.emoji || ''} ${status.content}`.trim(), created: status.created })).sort((a, b) => b.created - a.created); }); ```

## Why?

The same reason why I do anyth

Did you enjoy this article?

Recommend it — Standard Reader surfaces well-loved writing to more readers across the network.

Across the AtmosphereDiscussions