X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=bellevue_reporter_rss_renderer.py;h=4420c80a5ed10ccbfd2b797efc88e99f9306e1c3;hb=6cd5b068127501d2b48e8ac67b7432bffc5fce53;hp=4e1ff6261f31650c609ec153f3fcf3f878573809;hpb=6b8d4eeb7153617221f822a243a117f0bcab07bf;p=kiosk.git diff --git a/bellevue_reporter_rss_renderer.py b/bellevue_reporter_rss_renderer.py index 4e1ff62..4420c80 100644 --- a/bellevue_reporter_rss_renderer.py +++ b/bellevue_reporter_rss_renderer.py @@ -60,14 +60,19 @@ class bellevue_reporter_rss_renderer(gnrss.generic_news_rss_renderer): @staticmethod def looks_like_spam(title: str, description: str) -> bool: return ( - 'marketplace' in description - or 'national-marketplace' in description - or re.search('[Ww]eed', title) is not None - or re.search('[Cc]annabis', title) is not None - or re.search('[Cc]annabis', description) is not None - or 'THC' in title - or re.search('[Ll]ose [Ww]eight', title) is not None - or re.search('[Ll]ose [Ww]eight', description) is not None + description is not None + and title is not None + and ( + 'marketplace' in description + or 'national-marketplace' in description + or re.search('[Ww]eed', title) is not None + or re.search('[Cc]annabis', title) is not None + or re.search('[Cc]annabis', description) is not None + or 'THC' in title + or re.search('[Tt]op.[Rr]ated', title) is not None + or re.search('[Ll]ose [Ww]eight', title) is not None + or re.search('[Ll]ose [Ww]eight', description) is not None + ) ) def item_is_interesting_for_headlines(