Add1E commited on
Commit
7d8a0ef
·
verified ·
1 Parent(s): 2d60cc9

Update trend_crawl.py

Browse files
Files changed (1) hide show
  1. trend_crawl.py +2 -1
trend_crawl.py CHANGED
@@ -29,7 +29,8 @@ def process_trends_for_country(country_code, trends_list):
29
  if country_code not in trends_json:
30
  trends_json[country_code] = {"All categories" : {}}
31
  for trend in trends_list:
32
-
 
33
  category = None
34
  for topic_id in trend.topics:
35
  if topic_id in TREND_TOPICS:
 
29
  if country_code not in trends_json:
30
  trends_json[country_code] = {"All categories" : {}}
31
  for trend in trends_list:
32
+ if datetime.now() - convert_to_datetime(trend.started_timestamp[0]) > timedelta(days=2):
33
+ continue
34
  category = None
35
  for topic_id in trend.topics:
36
  if topic_id in TREND_TOPICS: