X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=bellevue_reporter_rss_renderer.py;h=4420c80a5ed10ccbfd2b797efc88e99f9306e1c3;hb=6cd5b068127501d2b48e8ac67b7432bffc5fce53;hp=70002695b9b130d44e6119b2320816fc0357cfc4;hpb=c6d31748857aeb8f361dadf93bd00e04d60bfb70;p=kiosk.git diff --git a/bellevue_reporter_rss_renderer.py b/bellevue_reporter_rss_renderer.py index 7000269..4420c80 100644 --- a/bellevue_reporter_rss_renderer.py +++ b/bellevue_reporter_rss_renderer.py @@ -60,15 +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('[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 + 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(