1
+
2
+ from instabot import Bot
3
+
4
+ bot = Bot ()
5
+ bot .login (username = "your_username" , password = "your_password" )
6
+
7
+ follow_opt = input ("Follow single or multiple users(y/n):" )
8
+ if follow_opt == 'y' or follow_opt == 'Y' :
9
+ to_follow = ["user_1" ,"user_1" ,"user_1" ,"user_1" ]
10
+ bot .follow (user_id = to_follow )
11
+
12
+ unfollow_opt = input ("Unfollow single or multiple users(y/n):" )
13
+ if unfollow_opt == 'y' or unfollow_opt == 'Y' :
14
+ to_unfollow = ["user_1" ,"user_1" ,"user_1" ,"user_1" ]
15
+ bot .unfollow (user_id = to_unfollow )
16
+
17
+ unfollow_non_opt = input ("Unfollow those who don't follow you(y/n): " )
18
+ if unfollow_non_opt == 'y' or unfollow_non_opt == 'Y' :
19
+ bot .unfollow_non_followers ()
20
+
21
+ message_opt = input ("Message single or multiple users (y/n): " )
22
+ if message_opt == 'y' or message_opt == 'Y' :
23
+ message = "hello!"
24
+ message_to = ["user_1" ,"user_1" ,"user_1" ,"user_1" ]
25
+ bot .send_message (text = message , user_ids = message_to )
26
+
27
+ media_opt = input ("Send media to single or multiple users (y/n): " )
28
+ if media_opt == 'y' or media_opt == 'Y' :
29
+ capt = "This is an image"
30
+ media_path = "image.jpg"
31
+ media_to = ["user_1" ,"user_1" ,"user_1" ,"user_1" ]
32
+ bot .send_media (media_id = media_path , user_ids = media_to , text = capt )
33
+
34
+ hash_like_opt = input ("Like posts having a hashtag (y/n): " )
35
+ if hash_like_opt == 'y' or hash_like_opt == 'Y' :
36
+ hashtag = ["hacktoberfest" ,"coding" ]
37
+ amount = 10
38
+ bot .like_hashtag (hashtag = hashtag , amount = amount )
39
+
40
+ block_opt = input ("Block single or multiple users (y/n):" )
41
+ if block_opt == 'y' or block_opt == 'Y' :
42
+ to_block = ["user_1" ,"user_1" ,"user_1" ,"user_1" ]
43
+ bot .block_users (user_ids = to_block )
44
+
45
+ approve_pend_opt = input ("Approve all pending follow requests (y/n):" )
46
+ if approve_pend_opt == 'y' or approve_pend_opt == 'Y' :
47
+ bot .approve_pending_follow_requests ()
48
+
49
+ hashtag_comment = input ("Comment on all posts containing a specific hashtag (y/n):" )
50
+ if hashtag_comment == 'y' or hashtag_comment == 'Y' :
51
+ hashtag_ = ["hacktoberfest" ,"coding" ]
52
+ comment_ = ["wow" , "nice" , "cool" ]
53
+ num_comments = 10
54
+ bot .comment_hashtag (hashtag_ , amount = num_comments , comments = comment_ )
55
+
56
+ user_hashtag_opt = input ("Get the username of all the users who have participated in a hashtag (y/n):" )
57
+ if user_hashtag_opt == 'y' or user_hashtag_opt == 'Y' :
58
+ hashtag = "hacktoberfest"
59
+ bot .get_hashtag_users (hashtag = hashtag )
60
+
61
+ bot .logout ()
0 commit comments