from feedparser import parse import random def _parse_single_rss_feed(url, entries): feed = parse(url) entrylength = len(entries) for entrynumber, entry in enumerate(feed.entries): if entry.has_key("title"): entries[entry.title] = [] entrylist = entries[entry.title] else: title = str(entrynumber + entrylength) entries[title] = [] entrylist = entries[title] entrylist.append(entry.description) return entries def parse_rss_feeds(urls): entries = {} for url in urls: entries = _parse_single_rss_feed(url, entries) return entries