New feed URL, added comment to facebook graph trouble spot.
dblume

dblume commited on 2022-02-11 09:46:04
Showing 1 changed files, with 4 additions and 2 deletions.

... ...
@@ -206,7 +206,7 @@ def process_feed(yaml_items):
206 206
     """Retrieve the url and process it.
207 207
     feed_info (in, out) A tuple that describes an individual feed, like its name and etag.
208 208
     """
209
-    feed = feedparser.parse('http://feeds.feedburner.com/TechCrunch')
209
+    feed = feedparser.parse('https://techcrunch.com/feed/')
210 210
     if hasattr(feed, 'status'):
211 211
         if feed.status == 304:
212 212
             pass
... ...
@@ -548,7 +548,8 @@ if __name__=='__main__':
548 548
             items = []
549 549
 
550 550
         with open(os.path.join(localdir, 'facebook-token.txt'), 'r') as f:
551
-            facebook_token = f.read()
551
+	    json_obj = json.load(f)
552
+	    facebook_token = json_obj['access_token']
552 553
 
553 554
         progress_text = ["read techcrunch.yaml"]
554 555
         process_feed(items)
... ...
@@ -575,6 +576,7 @@ if __name__=='__main__':
575 576
                         r_time = item[rhs_metric_times][i]
576 577
                         if r_time - item['orig_posted'] < 7200:
577 578
                             if item[rhs_metric][i] >= threshold:
579
+                                # Comment out when graph.facebook.com engagement returns only 0s.
578 580
                                 item['qualified'] = threshold
579 581
                                 break
580 582
                         else:
581 583