Spaces:
Runtime error
Runtime error
Commit
路
2f14689
1
Parent(s):
eb4e7e0
Update app.py
Browse files
app.py
CHANGED
@@ -82,7 +82,7 @@ with colT2:
|
|
82 |
|
83 |
def analizar_tweets(search_words, number_of_tweets):
|
84 |
tabla = []
|
85 |
-
if(number_of_tweets > 0):
|
86 |
tweets = api.user_timeline(screen_name = search_words,tweet_mode="extended", count= number_of_tweets)
|
87 |
result = []
|
88 |
|
@@ -120,7 +120,7 @@ def analizar_tweets(search_words, number_of_tweets):
|
|
120 |
tabla.append(muestra)
|
121 |
|
122 |
else:
|
123 |
-
muestra = st.text("Ingrese
|
124 |
tabla.append(muestra)
|
125 |
|
126 |
return tabla
|
@@ -199,7 +199,8 @@ def run():
|
|
199 |
localidad=st.checkbox('Localidad')
|
200 |
submit_button = col.form_submit_button(label='Analizar')
|
201 |
error =False
|
202 |
-
|
|
|
203 |
if submit_button:
|
204 |
# Condici贸n para el caso de que esten dos check seleccionados
|
205 |
if ( termino == False and usuario == False and localidad == False):
|
@@ -217,5 +218,17 @@ def run():
|
|
217 |
analizar_tweets(search_words,number_of_tweets)
|
218 |
elif (localidad):
|
219 |
tweets_localidad(search_words)
|
220 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
run()
|
|
|
82 |
|
83 |
def analizar_tweets(search_words, number_of_tweets):
|
84 |
tabla = []
|
85 |
+
if(number_of_tweets > 0 || search_words == "" ):
|
86 |
tweets = api.user_timeline(screen_name = search_words,tweet_mode="extended", count= number_of_tweets)
|
87 |
result = []
|
88 |
|
|
|
120 |
tabla.append(muestra)
|
121 |
|
122 |
else:
|
123 |
+
muestra = st.text("Ingrese los parametros correspondientes")
|
124 |
tabla.append(muestra)
|
125 |
|
126 |
return tabla
|
|
|
199 |
localidad=st.checkbox('Localidad')
|
200 |
submit_button = col.form_submit_button(label='Analizar')
|
201 |
error =False
|
202 |
+
|
203 |
+
|
204 |
if submit_button:
|
205 |
# Condici贸n para el caso de que esten dos check seleccionados
|
206 |
if ( termino == False and usuario == False and localidad == False):
|
|
|
218 |
analizar_tweets(search_words,number_of_tweets)
|
219 |
elif (localidad):
|
220 |
tweets_localidad(search_words)
|
221 |
+
|
222 |
+
with st.form("my_form_2"):
|
223 |
+
col,buff1, buff2 = st.columns([2,2,1])
|
224 |
+
st.write("Escoja una Opci贸n")
|
225 |
+
search_words = col.text_input("Introduzca la frase, el usuario o localidad para analizar y pulse el check correspondiente")
|
226 |
+
number_of_tweets = col.number_input('Introduzca n煤mero de tweets a analizar. M谩ximo 50', 0,50,0)
|
227 |
+
termino=st.checkbox('Frase')
|
228 |
+
usuario=st.checkbox('Usuario')
|
229 |
+
localidad=st.checkbox('Localidad')
|
230 |
+
submit_button = col.form_submit_button(label='Analizar')
|
231 |
+
|
232 |
+
|
233 |
+
|
234 |
run()
|