8e2b0ccbe2dede11b3c82d73ed45b9e4dde1d005
[kiosk.git] / wsj_rss_renderer.py
1 import generic_news_rss_renderer
2
3 class wsj_rss_renderer(generic_news_rss_renderer.generic_news_rss_renderer):
4     def __init__(self, name_to_timeout_dict, feed_site, feed_uris, page_title):
5         super(wsj_rss_renderer, self).__init__(
6             name_to_timeout_dict,
7             feed_site,
8             feed_uris,
9             page_title)
10         self.debug = 1
11
12     def debug_prefix(self):
13         return "wsj(%s)" % (self.page_title)
14
15     def get_headlines_page_prefix(self):
16         return "wsj-%s" % (self.page_title)
17
18     def get_details_page_prefix(self):
19         return "wsj-details-%s" % (self.page_title)
20
21     def should_use_https(self):
22         return True
23
24     def item_is_interesting_for_headlines(self, title, description, item):
25         return ("WSJ.com" not in title and
26                 "WSJ.com" not in description)
27
28     def item_is_interesting_for_article(self, title, description, item):
29         return ("WSJ.com" not in title and
30                 "WSJ.com" not in description)
31
32 # Test
33 #x = wsj_rss_renderer(
34 #    {"Fetch News" : 1,
35 #     "Shuffle News" : 1},
36 #    "feeds.a.dj.com",
37 #    [ "/rss/RSSWorldNews.xml" ],
38 #    "Test" )
39 #if x.fetch_news() == 0:
40 #    print "Error fetching news, no items fetched."
41 #x.shuffle_news()