-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.py
More file actions
31 lines (19 loc) · 652 Bytes
/
bot.py
File metadata and controls
31 lines (19 loc) · 652 Bytes
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
27
28
29
30
31
import tweepy
from time import sleep
from credentials import *
auth = tweepy.OAuthHandler( API_key, API_key_secret)
auth.set_access_token(Access_token, Access_token_secret)
api = tweepy.API(auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True)
search = '#UselessEducationMinister' #ResignAshwathNarayan
#(100DaysOfCode)
for tweet in tweepy.Cursor(api.search, search).items():
try:
tweet.favorite()
print('Tweet Liked')
tweet.retweet()
print("Retweet done")
sleep(100)
except tweepy.TweepError as e:
print(e.reason)
except StopIteration:
break