Google App Engine feed parser

Finally, I got rid of Buzzboost. This is a Feedburner utility to show a HTML representation of an RSS feed. You can use it to show a simple feed item list on say, Blogger - this means you don't have to use the full feed and parse it yourself.

Why would you want to do that in the first place? Well, Blogger doesn't have a "Recent posts" widget - or at least no widget with an acceptable data size. So, you can use Buzzboost to show the latest titles on your blog. In theory, it's a cool feature. However, Buzzboost failed on me too many times, so I decided to build a feed parser myself in Google App Engine.

An out-of-the-box feature isn't available, but you can use the UrlFetch method in combination with the excellent Python library called Universal Feed Parser by Mark Pilgrim. It works pretty well.  

For some reason, the UrlFetch method has problems with retrieving the feed. It might have something to do with a Google or Feedburner security thing, but I am not sure yet. I think I fixed it by adding a cache mechanism to the parser, using GAEutilities.

Here is an excerpt of the code of main.py.
Here is the code for templates.py.

Re-use it if you wish. By the way, I suck at Python, so it might have been done much nicer. However, it works for me. Tips and tricks are appreciated, though.







Popular searches

Tags