ESN 14682-090307-639570-85


Document Name: Checking RSS Feeds
Document Description: Checking RSS Feeds

Checking RSS Feeds


2009/03/07

My RSS feeds got screwed up again. That's a passive and evasive way of saying that *I* screwed up my feeds again. That's what I get for doing things while in the middle of having the flu; it's easy enough for me to screw up code when I'm healthy and alert - making changes while sick is just moronic.

I fixed it all up this morning but realized that I need something better to watch for this kind of screwup. After all, it's hardly the first time something has gone wrong and it's not even always my fault: the good folks at Feedburner have done their share now and then. I need a way to make sure my Feeds are really working.

Of course one way is to simply subscribe to your own feeds. If you see current data, you are all set. But if you don't, that doesn't necessarily mean something is wrong because the reader can be acting up on its own and not fetching current data.

You can quickly check a feed using a browser like Safari or Opera, but those too can get confused and refuse to fetch new data. More important for me is that I have a good number of feeds to check - I need a programmatic solution.

The Feedburner Awareness API is supposed to provide just the hooks needed. I've used that before to fetch RSS stats so my first thought was to look there. Indeed, the GetItemData call would seem to provide just what I want: a list of current feed items. Unfortunately, I couldn't get this to work. I don't know if it is just broken right now or if the documentation for the API is wrong, but I had no luck at all. I read the docs as indicating that "https://feedburner.google.com/api/awareness/1.0/GetItemData?uri=aplawrence/ZPYH" should return the XML file I want, but so far all that gets me is a "500" error. Oh well, I'll have to do it the hard way..

The hard way is actually fetching each feed and parsing it for the desired data. That's easy to pick out from a Feedburner feed: the lines I want begin with "<rdf:li".

A simple curl http://feeds2.feedburner.com/aplawrence/ZPYH | grep "<rdf:li" | head -1 will extract the latest feed item. I'll actual write something a bit more sophisticated so that I can compare that to what I know should be the latest item for the particular feed. That will at least make me aware of errors sooner than I might otherwise find them.


Author: Anthony Lawrence - Contact Author
Publisher: Anthony Lawrence
Licensee Name: Anthony Lawrence
Reference URL: http://aplawrence.com/Web/checking_rss.html
Copyright: All Rights Reserved
Registration Date: 3/7/2009 1:41:14 PM UTC
Views: 89




NUMLY.COM