0

通过 Twitter Rest API 1.1,可以在 15 分钟内执行的查询数限制为 180。

我想了解我剩余的查询数。文档在响应 JSON 中,“搜索​​/推文”部分有一个斜线。所以,我无法访问“剩余”部分。

我怎样才能访问

rate_limit_context -> 资源 -> 搜索 -> 搜索/推文 -> 剩余

用 php

4

3 回答 3

1

一种可能的解决方案是;

$result= get_object_vars($resources);
$result = get_object_vars($result['search']);
$result = get_object_vars($result['/search/tweets']);
$result = $result['remaining'];
于 2013-06-15T14:16:18.800 回答
0

这些答案都不起作用,如果您使用的类不能将 jason_decode 设置为 true(在调用中),那么您可以使用 {} 转义斜杠

所以 rate_limit_context -> 资源 -> 搜索 -> {'search/tweets'} -> 剩余

于 2013-06-21T16:13:08.147 回答
0

把它当作一个数组键

$json['search']['/search/tweets']['remaining']
于 2013-06-14T16:59:06.887 回答