File tree Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -167,8 +167,19 @@ By default, the bot looks up the 100 most recent tweets. You can change this num
167
167
my_bot = TwitterBot()
168
168
my_bot.auto_unfollow_nonfollowers()
169
169
170
+ If there are certain users that you would like to not unfollow, add their user id to the USERS_KEEP_FOLLOWING list.
171
+
170
172
You will need to manually edit the code if you want to add special users that you will keep following even if they don't follow you back.
171
173
174
+ ####Automatically unfollow all users.
175
+
176
+ from TwitterFollowBot import TwitterBot
177
+
178
+ my_bot = TwitterBot()
179
+ my_bot.auto_unfollow_all_followers()
180
+
181
+
182
+
172
183
####Automatically mute all users that you have followed
173
184
174
185
from TwitterFollowBot import TwitterBot
Original file line number Diff line number Diff line change @@ -398,9 +398,23 @@ def auto_unfollow_nonfollowers(self,count=None):
398
398
399
399
for user_id in not_following_back :
400
400
if user_id not in self .BOT_CONFIG ["USERS_KEEP_FOLLOWING" ]:
401
-
401
+
402
402
self .wait_on_action ()
403
-
403
+
404
+ self .TWITTER_CONNECTION .friendships .destroy (user_id = user_id )
405
+ print ("Unfollowed %d" % (user_id ), file = sys .stdout )
406
+
407
+ def auto_unfollow_all_followers (self ,count = None ):
408
+ """
409
+ Unfollows everyone that you are following(except those who you have specified not to)
410
+ """
411
+ following = self .get_follows_list ()
412
+
413
+ for user_id in following :
414
+ if user_id not in self .BOT_CONFIG ["USERS_KEEP_FOLLOWING" ]:
415
+
416
+ self .wait_on_action ()
417
+
404
418
self .TWITTER_CONNECTION .friendships .destroy (user_id = user_id )
405
419
print ("Unfollowed %d" % (user_id ), file = sys .stdout )
406
420
You can’t perform that action at this time.
0 commit comments