Spaces:
Running
Running
Update trend_crawl.py
Browse files- trend_crawl.py +2 -2
trend_crawl.py
CHANGED
@@ -27,7 +27,7 @@ trends_json = {}
|
|
27 |
|
28 |
def get_trends_base():
|
29 |
return Trends()
|
30 |
-
def process_trends_for_country(country_code, trends_list):
|
31 |
|
32 |
if country_code not in trends_json:
|
33 |
trends_json[country_code] = {"All categories" : {}}
|
@@ -82,7 +82,7 @@ def get_trends(countries: list):
|
|
82 |
tr = get_trends_base()
|
83 |
trends = tr.trending_now(geo=country)
|
84 |
|
85 |
-
process_trends_for_country(country, trends)
|
86 |
all_categories = trends_json[country]["All categories"]
|
87 |
# sorted_all_categories = dict(
|
88 |
# sorted(all_categories.items(), key=lambda x: x[1]["searchQueries"], reverse=True)
|
|
|
27 |
|
28 |
def get_trends_base():
|
29 |
return Trends()
|
30 |
+
def process_trends_for_country(country_code, trends_list, tr):
|
31 |
|
32 |
if country_code not in trends_json:
|
33 |
trends_json[country_code] = {"All categories" : {}}
|
|
|
82 |
tr = get_trends_base()
|
83 |
trends = tr.trending_now(geo=country)
|
84 |
|
85 |
+
process_trends_for_country(country, trends, tr)
|
86 |
all_categories = trends_json[country]["All categories"]
|
87 |
# sorted_all_categories = dict(
|
88 |
# sorted(all_categories.items(), key=lambda x: x[1]["searchQueries"], reverse=True)
|