-
Notifications
You must be signed in to change notification settings - Fork 4
/
enfurecido.py
26 lines (21 loc) · 938 Bytes
/
enfurecido.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import tweepy
import time
auth = tweepy.OAuthHandler('Ef3mbrQa2j83BFexT4xR1D5F5',
'rpjHvCtG4w9CFUmsaJOCOoGw4gqX4e7m504XhrfOJLldUvIegJ')
auth.set_access_token('1247064631484571651-ZkVHbqrC5JcBjnKXJcRArJkGRGPGwm',
'L0H3bW0RBjIBrMVwa4yHHRZEg0lvQfUWxwgwqCWezD2Ah')
api = tweepy.API(auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True)
search = 'amarelo'
numero = 1000
for tweet in tweepy.Cursor(api.search, search).items(numero):
try:
print(tweet.text.encode("utf-8"))
if((tweet.text.encode("utf-8"))=='amarelo'):
print("nome do usuario: @" + tweet.user.screen_name)
api.update_status("@" + tweet.user.screen_name + " concordo", in_reply_to_status_id=tweet.id)
print("tuite enviado corretamente")
time.sleep(30)
except tweepy.TweepError as e:
print(e.reason)
except StopIteration:
break