Twtxt is a free and open source project which touts itself as “a decentralized, minimalist microblogging service for hackers.” See the code repository. The project Readme explains that Twtxt is used by pulling status updates from a publicly available text file – with an “account” being a URL pointing to the publicly available text file. The Twtxt tool tracks a list of URLs pointing to properly formatted text files and from those it builds a timeline. Twtxt is currently most amenable to command line usage.

I recall having read about Twtxt on Hacker News and thought it sounded interesting. However, I put any thought of actually trying Twtxt on the back-burner because I did not initially understand how it worked. It had not occurred to me that I could add a Twtxt feed to The New Leaf Journal until I came across a post by Yukinu about adding a Twtxt feed to (see post). The Twtxt feed in the Yukinu Blog’s case creates a properly formatted Twtxt feed out of the blog posts there. Now Yukinu’s site is a handcrafted site whereas my project is built with WordPress. Moreover, while I am able to modify WordPress to some extent, writing a Twtxt feed generator is beyond my competence. I conducted a brief search around the WordPress plugin repositories but found nothing having to do with Twtxt.

While looking for something else on GitHub, I stumbled across a repository titled wordpress-twtxt. The repository is managed by Mr. Matthias Pfefferle, one of the leaders in designing IndieWeb integrations for WordPress. We already use several of his plugins, most notably one for adding Webmention functionality to The New Leaf Journal. The Readme for his WordPress Twtxt repository begins as follows:

This WordPress plugin provides a simple feed, you can follow using twtxt
nothing more… nothing less

Well that certainly sounded promising. The plugin is written in 100% PHP. As always, I do my research before installing a plugin, even if it comes from an experienced and trusted open source developer like Mr. Pfefferle. What works for one site may not work for another. For example, I have not implemented his very interesting looking Activity Pub plugin for WordPress because of how it uses usernames instead of nicenames for profiles. I was also curious whether there would be any issue stemming from the fact that it has not been updated for two years.

I poked around and saw nothing that raised any concerns for me. Moreover, Mr. Pfefferle includes a link to his personal WordPress blog Twtxt feed to show what it looks like in practice (as well as to invite Twtxt users to follow him). You can see his feed here.

Because everything looked good on the surface, I thought that it would be fun to add a Twtxt feed to The New Leaf Journal, so I took the plunge. This plugin is not in the WordPress repository, so it requires manual installation. See the steps below:

  1. Go to the wordpress-twtxt repo
  2. From “Code,” select “Download ZIP” under local
  3. In my case, I renamed the .zip file TWTXT since that is what the plugin name is, but this step is not necessary (note, it may be possible to remove 2 of the files from the zip but I opted not to)
  4. Then, from my WordPress admin panel, I selected Add New in the Plugins menu and then upload a plugin. I uploaded the file.
  5. Activate the plugin.
  6. While the plugin does include code to flush rewrite rules, this did not trigger when I uploaded. If the rewrite rules are not flushed, the Twtxt feed and possibly custom post types (if applicable) will return 404s. Rewrite rules can be flushed from the command line, but I quickly activated Rewrite Rules Inspector to flush the rules after install. If your Twtxt feed URL returns a 404, the first thing to check is whether you need to flush rewrite rules.

According to the Readme, the main site feed should be available at [base_url]/feed/twtxt. I checked…

Success! Our twtxt feed showing our 200 most-recent articles appeared.

Screenshot of The New Leaf Journal's Twtxt feed. The plain text webpage begins with an explanation of Twtxt and provides links to the main Twtxt project and to the plugin page for wordpress-twtxt.
Screenshot of our Twtxt feed in the Mullvad Browser. Visit the URL yourself to see the up-to-date feed.

I noted that it uses post numbers as URLs instead of the URL normally visible to visitors.

Instead of…

However, this is only an aesthetic issue. The first resolves as the second. At some point I will take a look at the plugin code and see if I can change the behavior, although maybe the shorter URLs are better for Twtxt readers in any event.

Mr. Pfefferle’s Readme for the plugin notes that it also creates author feeds. However, at least out of the box, the author feeds on The New Leaf Journal are the same as the general feed. For example, Victor V. Gurbo’s Twtxt feed is the exact same feed as the main New Leaf Journal feed, containing all articles regardless of author. The other limitation of the plugin as it comes out of the box is that it does not cover custom post types. For example, you can get specific feeds for our Leaf and Leaf Bud posts, which are separate from our main feed – but the Twtxt plugin does not create feeds for them on a fresh install.

At the moment, I am fine with how the Twtxt plugin behaves. Most Twtxt users who may be interested in The New Leaf Journal would likely want to prioritize our main article feed. Because Twtxt is not a reader, people who use it to visit our newest articles can also check our new Leaflets and Leaf Buds from The New Leaf Journal proper. However, if I have some time to kill or if there is general interest, I may look into modifying the plugin in the future to offer even more Twtxt options to New Leaf Journal visitors.

For the vast majority of readers who do not use Twtxt (much less know what Twtxt is), I doubt that you will find our Twtxt feed particularly useful – although it may be a nifty bookmark for low-powered devices or on phones with limited data plans. The best option for following The New Leaf Journal for most visitors is to use our RSS, ATOM, or JSON feeds, which also provide more following options than our Twtxt feed. You can see our full selection of feeds here. I also wrote a general introduction to RSS, ATOM, and JSON feeds for those who do not have experience using them.