met*_*afa 5 php api twitter rest rate-limiting
我正在使用 TwitterOAuth 在 PHP 中创建 Twitter Web 应用程序,但我很快就违反了速率限制。
stdClass Object ( [errors] => Array ( [0] => stdClass Object ( [code] => 185 [message] => 用户超出每日状态更新限制。) ) )
我正在做的是(在 API v1.1 中)
状态/retweet/:https://dev.twitter.com/rest/reference/post/statuses/retweet/%3Aid状态/更新 /:https://dev.twitter.com/rest/reference/post/statuses/更新
所以我阅读了有关速率限制的信息:
https://dev.twitter.com/rest/public/rate-limiting
https://dev.twitter.com/rest/public/rate-limits
https://dev.twitter.com/rest/reference/get/application/rate_limit_status
我没有找到有关如何知道我在 POST 速率限制方面的信息。阅读https://dev.twitter.com/rest/public/rate-limiting后,您会认为他们会在标头中向您发送该信息(X-Rate-Limit-Limit 等)。以下是您在发帖时返回的示例标题:
数组( [x_access_level] => 读写 [x_connection_hash] => 5872d62634487fcda6d02ad7ba09f306 [x_content_type_options] => nosniff [x_frame_options] => SAMEORIGIN [x_response_time] => 246 [x_transaction] => a960a1986a130b第96章> 1;模式=块)
他们说要包含的信息,但实际上没有包含。
此页面https://dev.twitter.com/rest/public/rate-limits也不会让您变得更聪明,因为它只列出了 GET 速率限制。
最后,我尝试按照此页面https://dev.twitter.com/rest/reference/get/application/rate_limit_status请求有关我的限制的信息(并且非常重要:就剩余帖子而言,我目前所处的位置)当前时间利率期间)。任何响应部分都不会让您知道您仍然可以在自己的时间线上发布多少条推文。顺便说一句,您确实可以获取调用此特定调用的频率限制信息:
数组( [x_access_level] => 读写 [x_connection_hash] => 147c9e14fc999b5c02f6ce425a8f906b [x_content_type_options] => nosniff [x_frame_options] => SAMEORIGIN [x_rate_limit_limit] => 180 [x_rate_limit_remaining] => 178 [x_ rate_limit_reset] => 1440932964 [x_response_time] = > 119 [x_transaction] => bfb31ca44b51d904 [x_twitter_response_tags] => BouncerCompliant [x_xss_protection] => 1; mode=block )
但这仅计入您可以使用 /application/rate_limit_status 的频率。此外,响应中列出的限制都不会通过对其 API 进行 POST 来减少。
Twitter 似乎故意让我们对此事一无所知。或者我没有得到什么?
| 归档时间: |
|
| 查看次数: |
736 次 |
| 最近记录: |