2 import generic_news_rss_renderer as gnrss
5 class seattletimes_rss_renderer(gnrss.generic_news_rss_renderer):
6 interesting_categories = frozenset(
11 "Technology" "Local News",
25 def __init__(self, name_to_timeout_dict, feed_site, feed_uris, page_title):
26 super(seattletimes_rss_renderer, self).__init__(
27 name_to_timeout_dict, feed_site, feed_uris, page_title
30 def debug_prefix(self):
33 def get_headlines_page_prefix(self):
34 return "seattletimes-nonnews"
36 def get_details_page_prefix(self):
37 return "seattletimes-details-nonnews"
39 def should_use_https(self):
42 def item_is_interesting_for_headlines(self, title, description, item):
43 if item.tag != "item":
44 self.debug_print("Item.tag isn't item?!")
46 if self.is_item_older_than_n_days(item, 14):
47 self.debug_print("%s: is too old!" % title)
51 for detail in item.getchildren():
53 "detail %s => %s (%s)" % (detail.tag, detail.attrib, detail.text)
55 if detail.text != None:
56 details[detail.tag] = detail.text
57 if "category" not in details:
58 self.debug_print("No category in details?!")
59 self.debug_print(details)
63 for x in seattletimes_rss_renderer.interesting_categories:
64 if x in details["category"]:
65 self.debug_print("%s looks like a good category." % x)
71 def item_is_interesting_for_article(self, title, description, item):
72 if self.is_item_older_than_n_days(item, 14):
73 self.debug_print("%s: is too old!" % title)
75 return len(description) >= 65
79 # x = seattletimes_rss_renderer({"Test", 123},
80 # "www.seattletimes.com",
83 # x.periodic_render("Fetch News")
84 # x.periodic_render("Shuffle News")