Skip to content

Instantly share code, notes, and snippets.

@danromero
Created July 14, 2020 18:07
Show Gist options
  • Save danromero/096ce18d584f7015823013edd4220a5d to your computer and use it in GitHub Desktop.
Save danromero/096ce18d584f7015823013edd4220a5d to your computer and use it in GitHub Desktop.
Twitter unlike script
import tweepy
ACCESS_TOKEN = '...'
ACCESS_SECRET = '...'
CONSUMER_KEY = '...'
CONSUMER_SECRET = '...'
def connect_to_twitter_OAuth():
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_TOKEN, ACCESS_SECRET)
api = tweepy.API(auth)
return api
api = connect_to_twitter_OAuth()
count = 0
while count < 50:
favorite_tweets = api.favorites()
for tweet in favorite_tweets:
x = tweet._json['id']
api.destroy_favorite(x)
count += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment