crunk-columns is a PESOS style website maker
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
695 B

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