Created
July 29, 2022 18:47
-
-
Save a3r0id/2e52b14c7327e52bec1cde8403518ac2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tweepy | |
from time import sleep | |
# Unfollows all users that aren't following you back. | |
# Twitter's rate-limiting allows about 800 unfollows per session. | |
SCREEN_NAME = "YOUR_TWITTER_HANDLE" | |
# Twitter Auth | |
auth = tweepy.OAuthHandler("", "") | |
auth.set_access_token("", "") | |
api = tweepy.API(auth) | |
followers = api.followers_ids(SCREEN_NAME) | |
friends = api.friends_ids(SCREEN_NAME) | |
for f in friends: | |
if f not in followers: | |
print ("Unfollowed {0}".format(api.get_user(f).screen_name)) | |
api.destroy_friendship(f) | |
sleep(0.25) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment