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
167167 my_bot = TwitterBot()
168168 my_bot.auto_unfollow_nonfollowers()
169169
170+ If there are certain users that you would like to not unfollow, add their user id to the USERS_KEEP_FOLLOWING list.
171+
170172You 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.
171173
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+
172183####Automatically mute all users that you have followed
173184
174185 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):
398398
399399 for user_id in not_following_back :
400400 if user_id not in self .BOT_CONFIG ["USERS_KEEP_FOLLOWING" ]:
401-
401+
402402 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+
404418 self .TWITTER_CONNECTION .friendships .destroy (user_id = user_id )
405419 print ("Unfollowed %d" % (user_id ), file = sys .stdout )
406420
You can’t perform that action at this time.
0 commit comments