Skip to content

Check friendship before retweeting. #1436

Answered by Harmon758
Chokitu asked this question in Questions
Discussion options

You must be logged in to vote

I'm not sure I understand what you're trying to do here. API.friends already returns users you're following. Why pass it back to API.show_friendship? If you already have the Tweet/Status object, you can simply check if the ID of the user who Tweeted is in your list (using the user attribute of the Status object and the corresponding id attribute of that User object, e.g. tweet.user.id), or if you wanted to check it in realtime, use API.show_friendship with that user ID.

Also, if you just wanted the IDs of the users you're following, you can use API.friends_ids instead.

In any case, to answer your question, you can use API.lookup_friendships to bulk lookup relationships to 100 user_ids at …

Replies: 13 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Harmon758
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
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 #1436 on December 15, 2020 20:47.