Skip to content

Favorite if the tweet is not favourited by me | Tweepy - Python #1434

Answered by Harmon758
altayko asked this question in Questions
Discussion options

You must be logged in to vote

You can simply check the favorited attribute of each Tweet/Status object, e.g.:

if not tweet.favorited:
    tweet.favorite()

See https://developer.twitter.com/en/docs/twitter-api/v1/data-dictionary/overview/tweet-object.

I don't think erroring in this way should impact your rate limit though, so you're likely hitting that regardless.
This will just reduce your number of calls to the POST favorites/create endpoint.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Harmon758
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question This is a question API This is regarding Twitter's API Discussion This was converted/moved from/to a discussion
2 participants
Converted from issue

This discussion was converted from issue #1434 on December 15, 2020 20:50.