Building Network Automation Solutions
6 week online course starting in September 2017

New ipSpace.net content feeds (and why I love Perl)

I’m slowly moving away from Feedburner, and started the process by creating a new web page listing all my content feeds.

Sounds great, right? Well, this isn’t how this particular yak shaving really started.

The true story

I try to publish a blog post with a free video every Friday (or so), and it’s a royal pain keeping track of all the videos I publish (at semi-random intervals) and the blog posts I’ve already written about them. I could have created a web page (or a simple SQL query) listing the recently-published videos, but creating a Perl script that would generate an automatic Atom feed from my content database looked like way more fun.

Have I already told you that Perl rocks? Whatever problem I’m facing, there’s usually a library that solves it (at least partially). It might need 20 dependency modules (most of them replicating the functionality other dependency modules used by other libraries provide), but let’s not be too narrow-minded.

A quick search returned several candidate libraries, and XML::Feed seemed to be the best fit. Half an hour later I had a working Atom feed, and tweaked it for another half hour to make it pass W3 validator (a really good idea unless you like troubleshooting weird RSS readers). Problem solved.

Well, not really. I wanted to make my feeds a bit fancier, so I created another domain name (feed.ipspace.net), which triggered a change in my Apache config. No big deal, cut-and-paste is a great problem solver ;).

Then I got a really neat idea – what if I would use the parsing part of XML::Feed to parse my blog and podcast feeds? Amazingly, everything worked on the first try, and as I already had memcached installed, it was very easy to cache the feeds locally. I got from a single feed to three feeds in almost no time.

Finally, I figured out it would be nice if the home page of the new “web site” (it’s really just a single script parsing the URL information) wouldn’t be empty, so I created a simple home page listing all the feeds.

Total time spent: several hours more than what I originally planned, but I’ve accidentally solved a problem I had on a back burner for months.

Enjoy the new feeds, and do let me know how you like them!

0 comments:

Post a Comment

You don't have to log in to post a comment, but please do provide your real name/URL. Anonymous comments might get deleted.