Python Script: Merge and sort multiple RSS Feed items in one Feed
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

[...] are also more advanced coding options with Python, PHP and Simple Pie. I haven’t spent enough time with wordpress.org to investigate Simple Pie [...]
investigating RSS post and comments feeds with tags and categories « Love's Camel
2011/10/30 at 18:17