python - Tweepy mentions_timeline returns an empty list -
i started make twitter api. don't have twitter account, api created one. tweeted 4 times, including mentions. when use mentions_timeline
this;
my_mentions = api.mentions_timeline() #print(my_mentions) #output: []
after loop on my_mentions parameters text
, screen_name
nothing returned.
what i'm doing wrong here? why it's empty list since mentioned people in tweets + how can search mentions user? there parameter in mentions_timeline()
object screen_name
or id
?
try using new cursor object follows:
api = tweepy.api(auth) mentions in tweepy.cursor(api.mentions_timeline).items(): # process mentions here print mentions.text
as per twitters documentation here
returns 20 recent mentions (tweets containing users’s @screen_name) authenticating user.
so cannot check other users mentions using method. achieve this, have uses twitters search api. tweepy's documentation check here
Comments
Post a Comment