I’m new to learning the Twitter API, but I am running up against what I see as a possible error.
I’m running some search queries and trying to check if tweets have already been favorited by the authenticated user.
This seems straight forward – the Tweet object returned by GET search/tweets has a “Favorited” field that should be set to true or false. But, for some reason, this doesn’t seem to function correctly.
When I print the Tweet object, I can see that the “Favorited” field is always blank, whether it has been favorited or not. It just returns “favorited =>” (i.e., null value). Because of this, I’m not able to perform any sort of logic operation on the value of the “Favorited” field.
Anyone else have this issue? Is there a way to correct it? Am I doing something incorrectly?
I am running to the same issue. Did you resolve this issue?
I’m not able to reproduce this. A null value implies that perhaps you’re not logged in as the user you thought? I can retrieve a tweet object that I have favourited and get back a “favorited: true” value; and vice-versa for those I have not.
Using twurl, for my account, twurl “/1.1/statuses/show.json?id=501737378172923912” shows true and twurl “/1.1/statuses/show.json?id=501759619539415040” shows false. I can’t reproduce a null value.
Andy, do I need to use statuses/show to retrieve the “Favorited” value?
Perhaps that’s what I’m doing wrong. I was simply looking at the Tweet object as returned by GET search/tweets. (Iterating through each individual status in a loop.)
I can try to adjust my code to then use GET statuses/show with the id_str returned by the search query. I’ll work on that tonight and reply back here if it works.
Thanks for the response!
Hello there!
I have the same issue in a twitter client that we are developing. JSON result not contain real state in “favourited” or “retweeted”. Always return “false”. I’m a autenticated user so that is not the problem.
Is there any solution without make a “GET statuses/show with the id_str” per tweet searched? In order to not exceed Twitter rate limit.
Thanks!