-
Notifications
You must be signed in to change notification settings - Fork 1
/
InstaBot.py
178 lines (115 loc) · 5.22 KB
/
InstaBot.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# MAIN FILE
from Like_A_Post import like_a_post
from Post_A_Comment import post_a_comment
from Get_User_Post import get_users_post
from GetOwnPost import get_own_post
from Get_User_Info import get_user_info
from Negative_Comment import delete_negative_comment
from Get_Comment_List import get_comment_list
from Get_Like_List import get_like_list
from SelfInfo import self_info
from DisaterManagement import Location
from colorama import init,Fore,Style
init()
import win32com.client as wincl
speak = wincl.Dispatch("SAPI.SpVoice")
show_menu = True
# Main Function Starts From Here
while show_menu:
speak.Speak("Welcome to Instagram bot")
print (Fore.BLUE+"Here are your menu options: \n")
speak.Speak("Here are your menu options")
print "1.Get your own details\n"
speak.Speak("Get your own details")
print "2.Get details of a user by username\n"
speak.Speak("Get details of a user by username")
print "3.Get your own recent post\n"
speak.Speak("Get your own recent post")
print "4.Get the recent post of a user by username\n"
speak.Speak("Get the recent post of a user by username")
print "5.Get a list of people who have liked the recent post of a user\n"
speak.Speak("Get a list of people who have liked the recent post of a user")
print "6.Like the recent post of a user\n"
speak.Speak("Like the recent post of a user")
print "7.Get a list of comments on the recent post of a user\n"
speak.Speak("Get a list of comments on the recent post of a user")
print "8.Make a comment on the recent post of a user\n"
speak.Speak("Make a comment on the recent post of a user")
print "9.Delete negative comments from the recent post of a user\n"
speak.Speak("Delete negative comments from the recent post of a user")
print "10.Check if there is a natural calamity\n"
speak.Speak("Check if there is a natural calamity at the default location")
print "11.Exit"
speak.Speak("Exit The application")
print (Style.RESET_ALL)
# Asking value from the user until they give the valid response
while (True):
try:
speak.Speak("Enter your choice")
menu_choice = int(raw_input("Now Kindly Enter Your Choice\n"))
except ValueError:
print "\nPlease Enter a valid value..!!"
continue
if (menu_choice) <0:
print "\nValue cannot be negative..!!"
continue
elif menu_choice >0 and menu_choice <=11:
break
else:
print "\nEnter a valid number...!!"
continue
if menu_choice == 1:
print "You Have Chosen option To Get Your Information\n"
print "Following Are Your Details"
self_info()
elif menu_choice == 2:
insta_username = raw_input(Fore.RED+Style.BRIGHT+"Enter Username.........\n")
print(Fore.GREEN+Style.BRIGHT+"wait work under process.......")
get_user_info(insta_username)
print (Style.RESET_ALL)
print("\n")
elif menu_choice == 3:
print (Fore.GREEN+Style.BRIGHT+"WAit Getting ur post.......\n")
get_own_post()
print (Style.RESET_ALL)
print("\n")
elif menu_choice == 4:
insta_username = raw_input(Fore.RED+Style.BRIGHT+"Enter Username.........\n")
print(Fore.GREEN+Style.BRIGHT+"Wait Downloading user post......")
get_users_post(insta_username)
print (Style.RESET_ALL)
print("\n")
elif menu_choice == 5:
insta_username = raw_input(Fore.RED+Style.BRIGHT+"Enter Username.........\n")
print(Fore.GREEN+Style.BRIGHT+"Wait getting information.....")
get_like_list(insta_username)
print (Style.RESET_ALL)
print("\n")
elif menu_choice ==6:
insta_username = raw_input(Fore.RED + Style.BRIGHT + "Enter Username.........\n")
print(Fore.GREEN + Style.BRIGHT + "Wait liking Ur POst......")
like_a_post(insta_username)
print(Style.RESET_ALL)
print("\n")
elif menu_choice ==7:
insta_username = raw_input(Fore.RED+Style.BRIGHT+"Enter Username.........\n")
print("\n"+Fore.GREEN+Style.BRIGHT+"Wait getting information.....\n")
get_comment_list(insta_username)
elif menu_choice == 8:
insta_username = raw_input(Fore.BLUE+Style.BRIGHT+"Enter the username of the user: ")
print(Fore.GREEN+Style.BRIGHT+"Wait Posting A Comment Is Under PROCESS")
post_a_comment(insta_username)
elif menu_choice == 9:
insta_username = raw_input(Fore.RED + Style.BRIGHT + "Enter Username.........\n")
print("\n" + Fore.GREEN + Style.BRIGHT + "Deleting negative comments if any.\n")
delete_negative_comment(insta_username)
print (Style.RESET_ALL)
print("\n")
elif menu_choice == 10:
insta_username = raw_input(Fore.RED + Style.BRIGHT + "Enter Username.........\n")
Location(insta_username)
elif menu_choice==11 :
speak.Speak("Exiting Application")
exit()
else:
print "Wrong choice"