DIY A Read-It-Later Service with RSS

I’m sure most of us have seen tools like Pocket, Instapaper, Omnivore, etc. If not, the idea is that you can save various links and articles you find across the web in one place so that you can more-easily “read it later”.

Lately, I’ve been trying to do more self-hosting and generally eject from Software-as-a-Service type things. Given that the web was literally invented for reading documents, it feels entirely wrong to use yet another service or subscription just to regain even basic functionality of a document.

Side note: I don’t want to disparage these services too much or say that nobody should use them. For my specific use-case, however, the various accounts and options and integrations and hosting and and and… all felt like overkill. Anyway…

My thought process went something like this:

  • I want to take all of my to-read URLs from various places around the internet and have them in an easy-to-access location (especially on my phone)
  • RSS was basically built for collecting articles into a feed
  • RSS feeds are kinda dying in part because a lot of sites that even offer one don’t embed content “after the fold” in the actual feed
  • To combat this, some RSS feed readers fetch the content from the embedded link and treat that as though it is more embedded content (e.g. Feeder)
  • RSS feeds are just a static XML file
  • I can make XML files
  • I can easily host static files somewhere on my Tailnet

If you haven’t figured it out, it’s really this simple: I dump articles I want to read into an XML file and point my RSS reader at that file.

For example, this is the bare-minimum RSS XML file that I tested:

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>Guy's Too Read</title>
    <link>example.com</link>
    <description>a too-read Guy's to-read list</description>
    <item>
      <title>Transport Layer Security</title>
      <link>https://en.wikipedia.org/wiki/Transport_Layer_Security</link>
    </item>
    <item>
      <title>Dendrite</title>
      <link>https://github.com/matrix-org/dendrite</link>
    </item>
  </channel>
</rss>

In my feed reader, I can just point it to a simple HTTP server and the articles show up nicely. The app itself does all of the work since it has the option to pull in the cleaned-up contents of the link as part of the feed item content itself.

Notice that each new entry is just a few lines. Lines that are so simple and few in number that a script or two to generate them should be trivial.

For example, this script takes a list of URLs as input and just outputs an XML file:

#!/bin/bash

cat <<EOF
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>Guy's Too Read</title>
    <link>example.com</link>
    <description>a too-read Guy's to-read list</description>
EOF

while read l; do
  t=`curl "$l" -so - | grep -iPo '(?<=<title>)(.*)(?=</title>)' || echo $l`
  echo "    <item>"
  echo "      <title>$t</title>"
  echo "      <link>$l</link>"
  echo "    </item>"
done <$1

cat <<EOF
  </channel>
</rss>
EOF

Also available here: https://gist.github.com/gjbianco/e4ade802363d68b4335468b9c3b13dd4

I could also easily make a vim macro for adding new URLs. It’s so simple that the possibilities abound.