0

By Twitter Rest API 1.1, number of queries which could performed in 15 minutes is limited to 180.

I want to learn my remaining query count. Documentation In response JSON, there is a slash at "search/tweets" section. So, I cant access to "remaining" part.

How can I access to

rate_limit_context -> resources -> search -> search/tweets -> remaining

with php

3 Answers3

1

One possible solution is;

$result= get_object_vars($resources);
$result = get_object_vars($result['search']);
$result = get_object_vars($result['/search/tweets']);
$result = $result['remaining'];
0

Just treat it like an array key

$json['search']['/search/tweets']['remaining']
Marc B
  • 356,200
  • 43
  • 426
  • 500
0

Neither of those answers work, if you are using a class that you can't set the jason_decode to true (in the call) then you can escape the slashes by using {}

So rate_limit_context -> resources -> search -> {'search/tweets'} -> remaining

iamdamnsam
  • 41
  • 3