I have been working on a way that I can get my podcasts downloaded and sync’d to my mp3player by my home server and it was interesting how simple it is to do with Python.
I have been using feedparser module which is very simple to get Fedora users are able to simply install this via yum the package is
python-feedparser
.
If you are not on fedora check you package manager or down load the module from http://www.feedparser.org
Using feedparser is a simple task. First import the module and load your feed into your script like so:
#! /bin/env python
import feedparser
# Lets import the feed of computer related posts from puredistortion.com.
feed = feedparser.parse('http://puredistortion.com/category/compstuff/feed/')
From here you are able to pull any data that you need from the feed. Feedparser formats the RSS feed into lists ad dictionaries to make working your way through the information a simple task.
For more information on how to extract the data from the feed once you have imported your RSS feed into your script have a look at http://www.feedparser.org/docs.
Or download a script that was the basis for what I am using to download podcasts to my home server here : get_rss.py (87)

