4 from typing import Dict, List, Optional
6 import generic_news_rss_renderer as gnrssr
9 class wsj_rss_renderer(gnrssr.generic_news_rss_renderer):
12 name_to_timeout_dict: Dict[str, int],
18 name_to_timeout_dict, feed_site, feed_uris, page_title
22 def debug_prefix(self) -> str:
23 return f"wsj({self.page_title})"
25 def get_headlines_page_prefix(self) -> str:
26 return f"wsj-{self.page_title}"
28 def get_details_page_prefix(self) -> str:
29 return f"wsj-details-{self.page_title}"
31 def find_image(self, item: xml.etree.ElementTree.Element) -> Optional[str]:
34 def should_use_https(self) -> bool:
37 def item_is_interesting_for_headlines(
38 self, title: str, description: str, item: xml.etree.ElementTree.Element
40 if self.is_item_older_than_n_days(item, 7):
42 return "WSJ.com" not in title and "WSJ.com" not in description
44 def item_is_interesting_for_article(
45 self, title: str, description: str, item: xml.etree.ElementTree.Element
47 if self.is_item_older_than_n_days(item, 7):
49 return "WSJ.com" not in title and "WSJ.com" not in description
53 # x = wsj_rss_renderer(
55 # "Shuffle News" : 1},
57 # [ "/rss/RSSWorldNews.xml" ],
59 # if x.fetch_news() == 0:
60 # print("Error fetching news, no items fetched.")