Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,6 @@ from datetime import datetime
|
|
| 6 |
import time
|
| 7 |
from tenacity import retry, stop_after_attempt, wait_exponential
|
| 8 |
|
| 9 |
-
# Função com retry para buscar tweets
|
| 10 |
@retry(
|
| 11 |
stop=stop_after_attempt(3),
|
| 12 |
wait=wait_exponential(multiplier=1, min=4, max=10),
|
|
@@ -27,7 +26,6 @@ def fetch_tweets(client, query, tweet_fields):
|
|
| 27 |
time.sleep(wait_time + 1)
|
| 28 |
raise e
|
| 29 |
|
| 30 |
-
# Função com retry para postar tweets
|
| 31 |
@retry(
|
| 32 |
stop=stop_after_attempt(3),
|
| 33 |
wait=wait_exponential(multiplier=1, min=4, max=10),
|
|
@@ -75,8 +73,8 @@ def main():
|
|
| 75 |
|
| 76 |
api = tweepy.API(auth, wait_on_rate_limit=True)
|
| 77 |
|
| 78 |
-
#
|
| 79 |
-
query = 'BBB25
|
| 80 |
tweet_fields = ['text', 'created_at', 'lang', 'public_metrics']
|
| 81 |
|
| 82 |
with st.spinner('Buscando tweets...'):
|
|
|
|
| 6 |
import time
|
| 7 |
from tenacity import retry, stop_after_attempt, wait_exponential
|
| 8 |
|
|
|
|
| 9 |
@retry(
|
| 10 |
stop=stop_after_attempt(3),
|
| 11 |
wait=wait_exponential(multiplier=1, min=4, max=10),
|
|
|
|
| 26 |
time.sleep(wait_time + 1)
|
| 27 |
raise e
|
| 28 |
|
|
|
|
| 29 |
@retry(
|
| 30 |
stop=stop_after_attempt(3),
|
| 31 |
wait=wait_exponential(multiplier=1, min=4, max=10),
|
|
|
|
| 73 |
|
| 74 |
api = tweepy.API(auth, wait_on_rate_limit=True)
|
| 75 |
|
| 76 |
+
# Nova query usando sintaxe correta da API v2
|
| 77 |
+
query = 'BBB25 lang:pt -is:retweet -is:reply'
|
| 78 |
tweet_fields = ['text', 'created_at', 'lang', 'public_metrics']
|
| 79 |
|
| 80 |
with st.spinner('Buscando tweets...'):
|