使用Twurl计算过去30天的推文数量 [英] Count number of Tweets from the past 30 days using Twurl
问题描述
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).
然后,在运行以下命令时
Then, when running the following
twurl "/1.1/tweets/search/30day/stackoverflow/counts.json?query=#jesus"
我知道
{错误":{消息":未授权:未启用流计数 请求",发送":"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"}}
据此,决定转到应用程序密钥和令牌,并重新生成Consumer API密钥和Access令牌&访问令牌机密.
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"
然后得到
{错误":{消息":令牌无效或过期.",发送":"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 is only available to paid premium accounts, and one needs to pay for premium access.
这篇关于使用Twurl计算过去30天的推文数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!