Eubolist's Blog

about IT, Linux, the web and much more

Posts Tagged ‘Scripting

Python Script: Merge and sort multiple RSS Feed items in one Feed

with 3 comments

In my first blog post a while back I wrote about showrss and how to concatenate multiple tv-shows into one personalized rss feed.

I’ve been using their service for about a year now and am quite happy with it. Sadly though, despite multiple requests, they haven’t included National Geographic and Discovery Channel documentaries yet. So today I took the time and wrote customfeed, a little python script that is able to fetch multiple feeds, sort the items and concatenate them in the right order to a new feed. Although I wrote the script for use with ezRSS feeds, it should work just as well with any other feeds (might need some little modifications or tweaks though).

The script depends on python-feedparser, so make sure you have that one installed:

sudo aptitude install python-feedparser

or:

sudo easy_install feedparser

The most convenient way is to set up a cronjob that executes customfeed.py every few hours or so. Mine looks like this:

24 */6 * * * /usr/local/bin/customfeed.py

Written by eubolist

2010/12/24 at 02:12