使用 Twurl 计算过去 30 天的推文数量 [英] Count number of Tweets from the past 30 days using Twurl

查看:30
本文介绍了使用 Twurl 计算过去 30 天的推文数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要从 具有特定主题标签的标准搜索 API 请求推文,我已经完成了

To request tweets from the Standard search API with a specific hashtag, I've done

twurl "/1.1/search/tweets.json?q=#jesus"

效果很好.现在想要使用 高级搜索 API使用标签耶稣计算过去 30 天的推文.

Tht worked fine. Now wanting to use the Premium search APIs to count the tweets from the past 30 days with the hashtag jesus.

其中有一个 Counts 端点,/search/:label/counts.

In it, there's a Counts endpoint, /search/:label/counts.

对于过去 30 天的推文,这是端点模式,/search/30day/:label/counts.json.

For the tweets from the past 30 days, that's the endpoint pattern, /search/30day/:label/counts.json.

我创建了一个 搜索推文:30 天沙盒,名称为 stackoverflow(即标签).

I've created a Search Tweets: 30-Days Sandbox with name stackoverflow (that is the label).

然后,在运行以下时

twurl "/1.1/tweets/search/30day/stackoverflow/counts.json?query=#jesus"

我明白了

{"error":{"message":"Unauthorized: Stream is not enabled for countrequests","sent":"2020-02-26T13:26:57+00:00","transactionId":"00f67ea10058270b"}}

{"error":{"message":"Unauthorized: Stream is not enabled for count requests","sent":"2020-02-26T13:26:57+00:00","transactionId":"00f67ea10058270b"}}

由此,决定转到应用程序密钥和令牌并重新生成消费者 API 密钥和访问令牌 &访问令牌秘密.

From this, decided to go to the app keys and tokens and regenerated both Consumer API keys and Access token & access token secret.

之后

twurl authorize --consumer-key ************** --consumer-secret *****************

并使用我得到的 PIN 码

and using the PIN code I get

授权成功

如果我再来一次

twurl "/1.1/tweets/search/30day/stackoverflow/counts.json?query=#jesus"

然后得到

{"error":{"message":"无效或过期的令牌.","sent":"2020-02-26T13:39:44+00:00","transactionId":"00dea42000a8a098"}}

{"error":{"message":"Invalid or expired token.","sent":"2020-02-26T13:39:44+00:00","transactionId":"00dea42000a8a098"}}

再次重新生成消费者 API 密钥和访问令牌 &访问令牌秘密但仍然没有成功.

Regenerated again both Consumer API keys and Access token & access token secret but still no success.

那我该怎么做?

推荐答案

Counts 仅适用于付费高级帐户,并且需要付费才能访问高级帐户.

Counts is only available to paid premium accounts, and one needs to pay for premium access.

使用此链接申请访问.

这篇关于使用 Twurl 计算过去 30 天的推文数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆