1 from bs4 import BeautifulSoup
2 import generic_news_rss_renderer
5 class google_news_rss_renderer(generic_news_rss_renderer.generic_news_rss_renderer):
6 def __init__(self, name_to_timeout_dict, feed_site, feed_uris, page_title):
7 super(google_news_rss_renderer, self).__init__(
14 def debug_prefix(self):
17 def get_headlines_page_prefix(self):
20 def get_details_page_prefix(self):
21 return "google-news-details"
23 def find_description(self, item):
24 descr = item.findtext('description')
25 source = item.findtext('source')
26 if source is not None:
27 descr = descr + " (%s)" % source
30 def munge_description(self, description):
31 soup = BeautifulSoup(description)
32 for a in soup.findAll('a'):
36 def find_image(self, item):
39 def should_use_https(self):
42 def item_is_interesting_for_headlines(self, title, description, item):
43 return not self.is_item_older_than_n_days(item, 2)
45 def item_is_interesting_for_article(self, title, description, item):
46 return not self.is_item_older_than_n_days(item, 2)
49 #x = google_news_rss_renderer(
51 # "Shuffle News" : 1},
53 # [ "/rss?hl=en-US&gl=US&ceid=US:en" ],
55 #if x.fetch_news() == 0:
56 # print("Error fetching news, no items fetched.")