Spaces:
Running
Running
Update trend_crawl.py
Browse files- 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:
|