hackdiary

The Chumpologica - an RSS feed combiner

Today we relaunched The Daily Chump, a multi-author IRC-based blog, with a shiny new look and a new feature: the chumpologica. This is a webpage (and RSS 1.0 feed) that aggregates entries from blogs written by regular contributors to the Chump. It's built using about 150 lines of python and takes its configuration from a FOAF file.

Update: I've now packaged and released this project as a proper distribution.

FOAF has a predicate in its vocabulary for indicating that a person has a weblog. bloginfo.py uses the Redland RDF framework to read the FOAF file and find the details of each weblog. It uses the very latest version of Redland's python support (which contains support for iterators, allowing nice syntax such as: for statement in model: print statement.subject) which is only available in the nightly source snapshots at the time of writing.

chumpologica.py is the program start point. It uses Mark Pilgrim's RSS parser to read in the RSS feeds, and puts the entries into a listed sorted by date. The date is taken from the entry's Dublin Core date property, unless that's missing in which case the time of retrieval is used. A hash is kept of entries seen on previous runs so that we don't get duplicate entries. After a run, the entries and hashes are pickled (serialised) into a file for reuse on the next run.

If new entries were found, Mark Nottingham's RSS.py is invoked to output a new RSS 1.0 file using the newest 30 items. Weblog information taken from the FOAF file is stored along with each entry using standard Dublin Core tags such as relation to point to the original blog and creator to give the name of the writer. The resulting RSS file is sufficient to be transformed using XSLT into the final webpage.

foaf python rss Posted by Matt Biddulph at June 30, 2003 09:15 PM

→ Raw Blog: The Chumpologica
→ Lost Boy: MS Bloggers in FOAF; Java Bloggers Next?
→ Lost Boy: Connect The Dots
→ Raw: Connect the Dots