Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Tweepy提到\u timeline返回一个空列表_Python_Python 3.4_Tweepy_Tweets_Mention - Fatal编程技术网

Python Tweepy提到\u timeline返回一个空列表

Python Tweepy提到\u timeline返回一个空列表,python,python-3.4,tweepy,tweets,mention,Python,Python 3.4,Tweepy,Tweets,Mention,我刚开始制作一个Twitter Api。通常我没有Twitter帐户,我为这个api创建了一个。我在推特上发了4次,包括一些提到。但是当我使用时,会像这样提到时间线 my_mentions = api.mentions_timeline() #print(my_mentions) #output: [] 然后,我用参数text,screen\u name对我提到的内容执行for循环,但没有返回任何内容 我做错了什么?为什么它是一个空列表,因为我在推文中提到了一些人+我如何才能搜索其他用户的提及

我刚开始制作一个Twitter Api。通常我没有Twitter帐户,我为这个api创建了一个。我在推特上发了4次,包括一些提到。但是当我使用
时,会像这样提到时间线

my_mentions = api.mentions_timeline()
#print(my_mentions)
#output: []
然后,我用参数
text
screen\u name
对我提到的内容执行for循环,但没有返回任何内容

我做错了什么?为什么它是一个空列表,因为我在推文中提到了一些人+我如何才能搜索其他用户的提及?
中是否有类似于
screen\u name
id
的提到时间轴()的参数

尝试按如下方式使用新选项:

api = tweepy.API(auth)

for mentions in tweepy.Cursor(api.mentions_timeline).items():
    # process mentions here
    print mentions.text
根据Twitters文档

返回最近20次提及(包含用户 @验证用户的屏幕名称)

因此,您无法使用此方法检查其他用户提及的内容。要实现这一点,您必须使用twitters进行tweepy的文档检查

导入tweepy

api=tweepy.api(auth)


api.indentions\u timeline()

尝试使用与使用api相同的配置文件访问您的配置文件,查看您的配置文件中是否存在提及内容。 并尝试从您尝试使用的不同帐户中提及twitter帐户。
这可能是因为twitter限制了您的活动,并且该帐户的回复/推文不可见。

仍然没有返回任何内容您必须使用您的twitter用户名“推文”并在推文中提及您自己,或者让其他人在推文中提及您。事实上,我把screen_name放进了references_timeline,出现了一个错误:tweepy.error.RateLimitError:[{'code':88,'message':'Rate limit extended'}]我只有4条tweet,其中2条提到了某人。请正确格式化您的代码。另外,考虑添加一些描述你的解决方案的线条。你的答案并不能解决问题。除了解决问题,还要格式化代码并解释答案。