forked from rhiever/TwitterFollowBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtwitterbot_hashtag.py
30 lines (24 loc) · 1.12 KB
/
twitterbot_hashtag.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
27
28
29
30
#!/usr/bin/python
from TwitterFollowBot import TwitterBot
# Set the while loop as active
active = True
# The while loop allows you to make corrections if you mistype the hashtag you want to follow
while active:
# Set the hashtag variable by getting input from the user
hashtag = input("Please enter a hashtag you would like to follow: ")
# Tell the user what they entered and ask for confirmation
confirm = input("You entered " + hashtag + ". Is this correct? [y or n] ")
if confirm == 'n':
# If the user says no ask if they want to enter a different hashtag
repeat = input("Would you like to enter a different hashtag? [y or n] ")
if repeat == 'n':
# If the user answers yes the loop will continue. If they answer no the script will end
print("This script will now end.")
quit()
# If the user answers yes to the original confirmation mark the while loop inactive
else:
active = False
# Start the TwitterBot instance
my_bot = TwitterBot()
# Auto follow the number of accounts given in "count" that match the hashtag confirmed by the user
my_bot.auto_follow(hashtag, count=800)