I just started to make a Twitter Api. Normally I don’t have a Twitter account, for this api I created one. I Tweeted 4 times, including some mentions. But when I use mentions_timeline
like this;
my_mentions = api.mentions_timeline()
#print(my_mentions)
#output: []
After then I do a for loop on my_mentions with parameters text
, screen_name
but nothing returned.
What I’m doing wrong here? Why it’s an empty list since I mentioned some people in the tweets + how can I search mentions for another user? Is there a parameter in mentions_timeline()
object like screen_name
or id
?
3
Answers
Try using the new Cursor Object as follows:
as per Twitters documentation here
so you cannot check other users mentions using this method. To achieve this, you will have to uses twitters search api. for tweepy’s documentation check here
import tweepy
api = tweepy.API(auth)
api.mentions_timeline()
Try going to your profile using the same of which you’re using the API and see whether the mentions exists in your profile.
and try mentioning the twitter account from different account which you trying from.
This might be the case where twitter had limited your activities and replies/tweets are not visible of that account.