【问题标题】:Using Tweepy to search for tweets with API 1.1使用 Tweepy 通过 API 1.1 搜索推文
【发布时间】:2013-09-05 23:43:46
【问题描述】:

在过去的 3 个小时里,我一直在努力寻找一个没有成功的 sring。我不断收到回复,它应该使用 api 1.1。我认为这已经实现了......因为我可以用 tweepy 发布。我做错了什么?

#!/usr/bin/env python

import tweepy

consumer_key = '***'
consumer_secret = '***'
access_token = '***'
access_token_secret = '***'

auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)

api = tweepy.API(auth)


results = api.search(q="Mice")

for result in results:
    print result.text

【问题讨论】:

  • 你能发布错误/输出,表明你没有做错,或者不是你想要的吗?

标签: python search twitter tweepy


【解决方案1】:

升级您的tweepy 版本:

pip install --upgrade tweepy

或者,直接从github安装:

git clone https://github.com/tweepy/tweepy.git
cd tweepy
python setup.py install

仅供参考,使用 2.1 版本测试您的代码 - 它可以工作。

【讨论】:

    猜你喜欢
    • 2018-02-24
    • 2020-03-30
    • 1970-01-01
    • 1970-01-01
    • 2013-06-09
    • 2013-05-30
    • 2017-02-18
    • 2018-07-03
    • 2021-02-23
    相关资源
    最近更新 更多