Created
July 14, 2020 18:07
-
-
Save danromero/096ce18d584f7015823013edd4220a5d to your computer and use it in GitHub Desktop.
Twitter unlike script
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 | |
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