Created
July 29, 2021 07:03
-
-
Save lokesh1729/cc8a4e99e958bb4530b49105a4178617 to your computer and use it in GitHub Desktop.
Unfollow everyone
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
import tweepy | |
import os | |
consumer_key = os.getenv("TWITTER_API_KEY") | |
consumer_secret = os.getenv("TWITTER_API_SECRET") | |
access_token = os.getenv("TWITTER_OAUTH_TOKEN") | |
access_token_secret = os.getenv("TWITTER_OAUTH_SECRET") | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
auth.set_access_token(access_token, access_token_secret) | |
api = tweepy.API(auth) | |
for friend in tweepy.Cursor(api.friends).items(): | |
resp = api.destroy_friendship(friend.id, friend.screen_name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment