Skip to content

Instantly share code, notes, and snippets.

@pkshultz
Last active December 22, 2019 21:35
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 pkshultz/427672fa72bbf5741b8f2cae616e27ba to your computer and use it in GitHub Desktop.
Save pkshultz/427672fa72bbf5741b8f2cae616e27ba to your computer and use it in GitHub Desktop.
Retrieve links to a user's liked tweets
import tweepy
consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = ""
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
# Print out each favorited tweet
for page in tweepy.Cursor(api.favorites,id="",wait_on_rate_limit=True, count=200).pages(200):
for status in page:
print("https://twitter.com/" + status.user.id_str + "/status/" + status.id_str)
@pkshultz
Copy link
Author

tweepy.Cursor() condition found in this Stack Overflow post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment