Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
from pytrends.request import TrendReq
|
| 2 |
import streamlit as st
|
| 3 |
import pandas as pd
|
| 4 |
-
|
| 5 |
|
| 6 |
|
| 7 |
def convert_into_pd(req_json):
|
|
@@ -40,21 +40,6 @@ categories = {
|
|
| 40 |
"Technik": "t",
|
| 41 |
}
|
| 42 |
|
| 43 |
-
pytrend = TrendReq(hl='de-AT', tz=360, timeout=(10,50))
|
| 44 |
-
real_trending_searches = {}
|
| 45 |
-
base_data = {}
|
| 46 |
-
|
| 47 |
-
for category_name, category_code in categories.items():
|
| 48 |
-
base = pytrend.realtime_trending_searches(pn='AT', cat=category_code, count=75)
|
| 49 |
-
base_data[category_name] = base
|
| 50 |
-
real_trending_searches[category_name] = convert_into_pd(base)
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
choices_list = list(real_trending_searches.keys())
|
| 54 |
-
auswahl = st.selectbox("Select Ressort", choices_list)
|
| 55 |
-
|
| 56 |
-
display_articles_for_category(auswahl)
|
| 57 |
-
|
| 58 |
def check_password():
|
| 59 |
"""Returns `True` if the user had the correct password."""
|
| 60 |
|
|
@@ -80,4 +65,20 @@ def check_password():
|
|
| 80 |
|
| 81 |
|
| 82 |
if not check_password():
|
| 83 |
-
st.stop() # Do not continue if check_password is not True.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from pytrends.request import TrendReq
|
| 2 |
import streamlit as st
|
| 3 |
import pandas as pd
|
| 4 |
+
import hmac
|
| 5 |
|
| 6 |
|
| 7 |
def convert_into_pd(req_json):
|
|
|
|
| 40 |
"Technik": "t",
|
| 41 |
}
|
| 42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
def check_password():
|
| 44 |
"""Returns `True` if the user had the correct password."""
|
| 45 |
|
|
|
|
| 65 |
|
| 66 |
|
| 67 |
if not check_password():
|
| 68 |
+
st.stop() # Do not continue if check_password is not True.
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
pytrend = TrendReq(hl='de-AT', tz=360, timeout=(10,50))
|
| 72 |
+
real_trending_searches = {}
|
| 73 |
+
base_data = {}
|
| 74 |
+
|
| 75 |
+
for category_name, category_code in categories.items():
|
| 76 |
+
base = pytrend.realtime_trending_searches(pn='AT', cat=category_code, count=75)
|
| 77 |
+
base_data[category_name] = base
|
| 78 |
+
real_trending_searches[category_name] = convert_into_pd(base)
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
choices_list = list(real_trending_searches.keys())
|
| 82 |
+
auswahl = st.selectbox("Select Ressort", choices_list)
|
| 83 |
+
|
| 84 |
+
display_articles_for_category(auswahl)
|