This is the current running state of the kiosk sans the secrets.
[kiosk.git] / bellevue_reporter_rss_renderer.py
index 70002695b9b130d44e6119b2320816fc0357cfc4..4420c80a5ed10ccbfd2b797efc88e99f9306e1c3 100644 (file)
@@ -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(