Getting this blog started reminded me about RSS feeds.
I started subscribing to a few, and at some point thought it would be cool to share the stuff I follow on here. You know, try and make the web an actual web again.
I'm sure there's already a bunch of tools to do just that, but one of the selling points of RSS is that it's simple. So let's build this thing ourselves and have some fun, shall we ?
I haven't written a single line yet, and just started thinking about how to proceed. So that's what today's rambling is gonna be about. Maybe hacking on it will give me more article ideas, but I suspect it won't. There's not a lot to say about parsing some dumb XML.
What's this RSS thing ?
If you don't know what RSS is, it's really not hard to understand:
-
A website owner sets up a page that's really nothing more than a list of all published articles, formatted in a markup language that dumb computers can make sense of. If he's feeling fancy, he might setup several of those feeds for different categories or comments threads. Have a look on this site's feed. It's ugly, but figuring out what this mess is about really isn't rocket science, is it ?
-
People interested in what this guy has to say copy the feed's link into some RSS reader application. That program's job is to simply go and check whatever it's subscribed to at regular intervals (you can configure it to update once a day, or every 10 minutes, or whatever suits you). Optionally trigger a desktop notification when something gets added to one of the lists, and you're done.
That's it. You can add some bells and whistles if you feel like it, but the basics are that simple. Automating the feed's generation is easy to begin with, and any decent web tool will probably handle it for you anyway. Implementing a basic reader is a fun beginner's project.1
This is much cleaner than relying on some social media platform to keep you up to date via push notifications (which they'll gladly do, as it is a wonderful way to build up your addiction).
While the end result might look pretty similar, with RSS, all that happens is that your machine periodically goes and checks whatever people have been doing. Technically, it's exactly the same than manually going to each individual site to see if they posted anything new. It's just automated, and handled by a program you can configure or uninstall if you decide you don't like it. You remain in control. Since you're getting the data straight from the source, there's no need to trust anyone but the site you're checking out. No one has to stand in the way and monitor your activity or fill your feed with targeted trash.
The protocol's simplicity also means that anyone who cares can implement his own tools to handle it. This doesn't prevent bad actors to try and get people to use their own, shittier tools, but at least competing with them is technically much easier than if we were dealing with operating systems or web browsers.
RSS is old tech. It's not flashy, but it does its job and has been around for a long time.2 The tech giants would love to kill it, but no one's stopping you from using it again. Keeping up to date with whatever's happening is the main reason I hear from people to still use social media. Turns out we never needed them for that.
Technical choices
So, before diving in, let's take a minute and figure out what we're trying to do.
This site is statically generated, which is at odds with the fundamentally dynamic content I'll be dealing with. The page listing the feeds needs to update on its own, so I need to be able to periodically regenerate it. The most straightforward way to do that is to simply set up a cron job.
I don't really see a reason to tie the page generation to pelican or some other specific framework. A standalone script seems like the most flexible solution. If I keep the link gathering logic and the html production separate, then the API should be easier to adapt for different situations (like skipping the html output and simply passing the list to a Django template). I'll keep that in mind while hacking up the first draft.
I'm tempted to fool around with some new language, but the one I can rely on being installed on just about any server is Python.3 Since it's just a simple script, it won't have to interface with anything, so there's no need to deal with WSGI or anything like that for deployment. Seems like the perfect tool for the job.
I'll need to store the urls I'm watching somewhere. And maybe some other optional things. This means having a config file. For the sake of KISS, let's dump all that in a simple python file, Django style.
Now for the presentation. I want to organize the feeds in multiple categories. I'm picturing it as a grid of boxes each containing the links for one cateogry. Should be simple enough.
For some reason I want to play with some htmx, but is that even needed ? The whole page is gonna get rebuilt everytime it needs to update, so there's really no use for it. I dunno. Maybe I'll find a way to shoehorn it in. We'll see when we get there.
If I want to get fancy, maybe I'll allow the user to rearrange the boxes, minimize them, or whatever. This could make for some nice UI practice. But again, that stuff can be dealt with later, so let's keep the first version basic.
Allright, I guess this is my spec. Now let's forget all about it and fool around.
-
Of course, turning it into something practical is where the real work begins, especially if you want non tech-savy people to use it. But that's interface work, really. The base logic is still child's play. ↩
-
The first official spec came out in 1999. ↩
-
I guess there's also Bash. This could actually be a good occasion to get more familiar with the classic unix tools. But this will take me longer and possibly require more dependencies. Also, I hate Bash syntax. ↩