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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -