Skip to content

Instantly share code, notes, and snippets.

@z0ph
Created March 15, 2021 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save z0ph/21a48bd70451e82c4cc09f361d41b856 to your computer and use it in GitHub Desktop.
Save z0ph/21a48bd70451e82c4cc09f361d41b856 to your computer and use it in GitHub Desktop.
Unfollow everyone on Twitter.
#!/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