Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -248,7 +248,7 @@ if 'base_load_finished' not in st.session_state or st.session_state.reset:
|
|
248 |
for country_name, pn_option in country_list.items():
|
249 |
st.session_state["base_data"][pn_option] = {}
|
250 |
st.session_state["real_trending_searches"][pn_option] = {}
|
251 |
-
st.session_state["today"][pn_option] = pytrend.today_searches(pn=pn_option)
|
252 |
|
253 |
st.session_state["base"][pn_option] = crawl_url(url=f"https://trends.google.com/trends/trendingsearches/daily?geo={pn_option}&category=2")
|
254 |
st.session_state["real_trending_searches"][pn_option] = convert_into_dict(st.session_state["base"][pn_option])
|
@@ -326,19 +326,19 @@ if st.sidebar.button("Change Country"):
|
|
326 |
elif selected_country == "DE":
|
327 |
st.session_state["pn"] = selected_country
|
328 |
|
329 |
-
selected_option = st.sidebar.radio("Choose an option", ["Realzeit Anfragen", "
|
330 |
st.warning("Die aufgelisteten Keywörter für erhöhte Reichweite in den Überschriften verwenden")
|
331 |
|
332 |
-
if selected_option == "Tagesaktuelle Anfragen":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
333 |
|
334 |
-
|
335 |
-
try:
|
336 |
-
display_articles_for_today(count, index)
|
337 |
-
except Exception as e:
|
338 |
-
st.code(e)
|
339 |
-
continue
|
340 |
-
|
341 |
-
elif selected_option == "Realzeit Anfragen":
|
342 |
|
343 |
raw_choices_list = list(st.session_state["real_trending_searches"][selected_country].keys())
|
344 |
cleaned_to_raw_mapping = {re.sub(r"\s\(\d+\)$", "", choice): choice for choice in raw_choices_list}
|
|
|
248 |
for country_name, pn_option in country_list.items():
|
249 |
st.session_state["base_data"][pn_option] = {}
|
250 |
st.session_state["real_trending_searches"][pn_option] = {}
|
251 |
+
#st.session_state["today"][pn_option] = pytrend.today_searches(pn=pn_option)
|
252 |
|
253 |
st.session_state["base"][pn_option] = crawl_url(url=f"https://trends.google.com/trends/trendingsearches/daily?geo={pn_option}&category=2")
|
254 |
st.session_state["real_trending_searches"][pn_option] = convert_into_dict(st.session_state["base"][pn_option])
|
|
|
326 |
elif selected_country == "DE":
|
327 |
st.session_state["pn"] = selected_country
|
328 |
|
329 |
+
selected_option = st.sidebar.radio("Choose an option", ["Realzeit Anfragen", "Trends von Gestern"])#, "Tagesaktuelle Anfragen"
|
330 |
st.warning("Die aufgelisteten Keywörter für erhöhte Reichweite in den Überschriften verwenden")
|
331 |
|
332 |
+
#if selected_option == "Tagesaktuelle Anfragen":
|
333 |
+
#
|
334 |
+
# for count, index in enumerate(st.session_state["today"][selected_country], start=0):
|
335 |
+
# try:
|
336 |
+
# display_articles_for_today(count, index)
|
337 |
+
# except Exception as e:
|
338 |
+
# st.code(e)
|
339 |
+
# continue
|
340 |
|
341 |
+
if selected_option == "Realzeit Anfragen":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
342 |
|
343 |
raw_choices_list = list(st.session_state["real_trending_searches"][selected_country].keys())
|
344 |
cleaned_to_raw_mapping = {re.sub(r"\s\(\d+\)$", "", choice): choice for choice in raw_choices_list}
|