|
|
@ -167,18 +167,12 @@ class Publications(Bureau):
|
|
|
|
def _get_news(self):
|
|
|
|
def _get_news(self):
|
|
|
|
"""fetch a set of latest news entries from sources specified in config
|
|
|
|
"""fetch a set of latest news entries from sources specified in config
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
feeds = self.config["newsfeeds"]
|
|
|
|
entries = []
|
|
|
|
entries = []
|
|
|
|
|
|
|
|
|
|
|
|
# TODO: come up with a good way to make this configurable
|
|
|
|
|
|
|
|
feeds = [("http://feeds.bbci.co.uk/news/world/rss.xml", 10),
|
|
|
|
|
|
|
|
("http://rss.liberation.fr/rss/latest/", 10),
|
|
|
|
|
|
|
|
("http://feeds.arstechnica.com/arstechnica/index/", 10),
|
|
|
|
|
|
|
|
("http://feeds.feedburner.com/zerohedge/feed", 5),
|
|
|
|
|
|
|
|
("http://planet.python.org/rss20.xml", 5)]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for source in feeds:
|
|
|
|
for source in feeds:
|
|
|
|
url = source[0]
|
|
|
|
url = source["url"]
|
|
|
|
num_entries = source[1]
|
|
|
|
num_entries = source["count"]
|
|
|
|
|
|
|
|
|
|
|
|
# get feed data with requests using a timeout
|
|
|
|
# get feed data with requests using a timeout
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|