【问题标题】:Twitter API query using python Twitter gives few results使用 python Twitter 的 Twitter API 查询几乎没有结果
【发布时间】:2016-06-23 17:42:02
【问题描述】:

我正在使用 Python Twitter 从有关 YouTube 视频的推文中下载数据:https://github.com/bear/python-twitter/blob/master/doc/index.rst

def TW():
    return twitter.Api(consumer_key='X',consumer_secret='X',access_token_key='X-X',access_token_secret='X')

for i in TW().GetSearch(term='https://www.youtube.com/watch?v=ftP6Uh_jSUg', count=1000, include_entities=True):
    print('TWEET_URL','twitter.com/'+str(i.user.screen_name)+'/status/'+str(i.id),i.urls,'RETWEETS',i.retweet_count,'USER_MENTIONS',i.user_mentions,'TEXT',i.text,'USER_ID',i.user.id,'USER',i.user.screen_name)

当我使用 GetSearch 时,我得到的结果很少。例如,我在之前的视频查询中只得到了这个。

TWEET_URL twitter.com/Niza_Club/status/740770459030032384 [URL(URL=XX, ExpandedURL=https://youtu.be/ftP6Uh_jSUg)] RETWEETS 0 USER_MENTIONS [User(ID=10228272, ScreenName=YouTube)] TEXT Juniore - A la plage vía @YouTube USER_ID 20470260 USER Niza_Club

虽然在 Twitter 上手动完成的相同查询给了我 15 个结果,其中包括上个月的 5 个:https://twitter.com/search?q=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DftP6Uh_jSUg&src=typd

我怎样才能得到其他结果?有没有更好的工具使用 Twitter API?一个没有它?

【问题讨论】:

    标签: python twitter python-twitter


    【解决方案1】:

    在这里找到答案:Can I use twitter api to search tweets one week before?

    另外请注意,twitter.com 上的搜索结果可能会返回历史结果,而搜索 API 通常只提供过去一周的推文。 - Twitter documentation.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-13
      • 1970-01-01
      • 2015-09-17
      • 2017-01-28
      • 2014-07-09
      相关资源
      最近更新 更多