#!/usr/bin/env python import urllib, xml.dom.minidom from xml.dom.minidom import Node def gettext(node): result = '' for child in node.childNodes: if child.nodeType == Node.TEXT_NODE: result += child.data return result print 'Content-Type: text/html' print feeds = ['http://nyt.weblogs.com/rss.xml', 'http://slashdot.org/slashdot.rss', 'http://www.newsisfree.com/HPE/xml/feeds/96/696.xml', 'http://www.newsisfree.com/HPE/xml/feeds/53/2353.xml'] for url in feeds: stream = urllib.urlopen(url) rdf = xml.dom.minidom.parse(stream) channel = rdf.getElementsByTagName('channel')[0] titlenode = channel.getElementsByTagName('title')[0] channelname = gettext(titlenode) print '