Spaces:
Running
Running
Update trend_crawl.py
Browse files- trend_crawl.py +3 -1
trend_crawl.py
CHANGED
@@ -24,6 +24,8 @@ TREND_TOPICS = {
|
|
24 |
19: "Travel and Transportation"
|
25 |
}
|
26 |
|
|
|
|
|
27 |
def process_trends_for_country(country_code, trends_list, trends_json):
|
28 |
if country_code not in trends_json:
|
29 |
trends_json[country_code] = {"All categories" : {}}
|
@@ -72,7 +74,7 @@ def get_trends(countries: list):
|
|
72 |
for country in countries:
|
73 |
trends = tr.trending_now(geo=country)
|
74 |
|
75 |
-
|
76 |
all_categories = trends_json[country]["All categories"]
|
77 |
return trends_json
|
78 |
|
|
|
24 |
19: "Travel and Transportation"
|
25 |
}
|
26 |
|
27 |
+
trends_json = {}
|
28 |
+
|
29 |
def process_trends_for_country(country_code, trends_list, trends_json):
|
30 |
if country_code not in trends_json:
|
31 |
trends_json[country_code] = {"All categories" : {}}
|
|
|
74 |
for country in countries:
|
75 |
trends = tr.trending_now(geo=country)
|
76 |
|
77 |
+
process_trends_for_country(country, trends)
|
78 |
all_categories = trends_json[country]["All categories"]
|
79 |
return trends_json
|
80 |
|