23 Jun 2026
Every blog should have a feed. Back I guess 20-something years ago, google reader was my primary way of consuming internet stuff. When it was killed I migrated to feedly, but I also noticed that the personal blogs started to fade as people migrated to social media. And every corporate news site wanted to have their writers publish a blog, so blog feeds lost their personality. Or something like that.
Anyway, the point is that the feed and aggregation of those feeds is one of the key components to the blog-o-sphere.
So I need a feed.
Yesterday morning, I don't actually remember why, but I started reading through the RSS spec. That was actually the impetus behind creating yesterday's post. And now I've got some content, surely I can just reformat that into some XML and call it a feed? Well, sure, but it turned out to be a bit more involved than I expected, so unless I want to double the hand coding effort, I'm going to need some sort of generator script.
A quick search found PyRSS2Gen, a python script that outputs a RSS XML file. The top part was easy; its all static values for the blog metadata. For the items list, I was fine with maintaining a list of the posts in the script in reverse chronological order; I don't want to rely on filesystem timestamps for the sort order. Ah, but now I need to fill in the post title and content ... ugh. I guess I will parse the html to extract the page body and grab the first heading for a title, but for now I'm pulling the title from the filename and skipping the description field. The link was easy enough to generated from the filename, and the guid is the same as the link, at least I think that is the convention for these things. But the date published? Hmm, again I don't want to rely on file timestamps. Should I hand code it somewhere, maybe in the same post list that I'm maintaining in the generator? That may be the quick solution for now, but I think the long term solution will be to somehow grab the first file commit timestamp from git. Then I can automate the whole post list generation which will get me have way to a generator for the index page. Two birds, one stone.
Anyway, I've skipped the description and pubDate fields for now and finished the RSS generator, and fed the output to the online RSS validator. It passed with 2 suggestions: firstly, a 'missing atom:link with rel="self" - that's not present in PyRSS2Gen, so move on; secondly, lastBuildDate was set to a time in the future. Python datetime.now(), by default, returns a timestamp without a timezone, so the RSS feed had the local clock time, but published as GMT. Easy enough to fix.
But now its got me wondering how to fill in the published date. The timestamp I pull out of will be local time, so I'll need to convert to UTC for the RSS feed, I expect. The index page generator, however, will want to use the local time for date headers on the page. Cool, cool, that should work.