ActivePython and Amara

James fphsml at gmail.com
Wed Dec 14 06:02:34 EST 2005


OK! The story so far ...
You wanted to parse an RSS feed and wanted a simple library. You tried
Amara. The binary installer had a problem. Not sure what was the issue
with installing the source via distutils.

Since you have way too many options to do this, it is probably better
to switch to another module for now.

ElementTree is another good module
http://effbot.org/downloads/elementtree-1.2.6-20050316.win32.exe

Following is a snippet of code that probably does what you want.
You should be able to extend it from there.
You might want to read this before you finish your aggregator.
http://diveintopython.org/http_web_services/review.html
Basically some netiquette when you repeatedly poll someone's server.
---------------------------------------------------------------------------------------

from elementtree import ElementTree as ET
from urllib import urlopen

rss = ET.parse(urlopen('http://www.digg.com/rss/index.xml'))
title = rss.find('//channel/title').text
articles = [item.find('title').text for item in
rss.findall('//channel/item')]




More information about the Python-list mailing list