【问题标题】:Using python to retrieve popular tweets使用python检索热门推文
【发布时间】:2015-05-23 18:29:38
【问题描述】:

我正在使用 Twython 来获取热门推文。但是,每个搜索函数调用我只能得到 15 个。我已经尝试将 count 参数传递给函数以获取更多信息,但它一直返回 15。

代码如下:

result = twitter.search(q='a', count=100, result_type='popular')

for item in result['statuses']:
    print(item['text'].encode('ascii', 'ignore'))

我也试过设置 count='100' 和 count="100" 但还是一样。

谢谢。

【问题讨论】:

    标签: python twitter


    【解决方案1】:

    试试:

    result = twitter.search(q='a', count=100)

    虽然这不适用于result_type='popular',但我还没弄清楚原因。

    还可以在此处查看分页搜索结果:Twython search API with next_results

    【讨论】:

      【解决方案2】:

      同样的事情发生在我身上,twitter-node-client 供未来的搜索者使用。看起来是bug with the Twitter api

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-01-18
        • 1970-01-01
        • 2016-04-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多