Created
March 15, 2021 17:20
-
-
Save z0ph/21a48bd70451e82c4cc09f361d41b856 to your computer and use it in GitHub Desktop.
Unfollow everyone on Twitter.
This file contains hidden or 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
#!/usr/bin/env python | |
import tweepy | |
from config import create_api | |
def unfollow_everyone(api): | |
friends = api.friends_ids("<your_twitter_screen_name") | |
for f in friends: | |
print("Unfollowing {0}".format(api.get_user(f).screen_name)) | |
api.destroy_friendship(f) | |
def main(): | |
api = create_api() | |
unfollow_everyone(api) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment