applicationRateLimitStatus() public method

Each 1.1 API resource belongs to a "resource family" which is indicated in its method documentation. You can typically determine a method's resource family from the first component of the path after the resource version. This method responds with a map of methods belonging to the families specified by the resources parameter, the current remaining uses for each of those resources within the current rate limiting window, and its expiration time in epoch time. It also includes a rate_limit_context field that indicates the current access token context. You may also issue requests to this method without any parameters to receive a map of all rate limited GET methods. If your application only uses a few of methods, please explicitly provide a resources parameter with the specified resource families you work with.
public applicationRateLimitStatus ( array $resources = null ) : string
$resources array A comma-separated list of resource families you want to know the current rate limit disposition for. For best performance, only specify the resource families pertinent to your application.
return string
Beispiel #1
0
 /**
  * Tests Twitter->applicationRateLimitStatus()
  */
 public function testApplicationRateLimitStatus()
 {
     $response = $this->twitter->applicationRateLimitStatus();
     $this->assertArrayHasKey('rate_limit_context', $response);
     $this->assertArrayHasKey('resources', $response);
     foreach ($response['resources'] as $row) {
         foreach ($row as $subRow) {
             $this->assertArrayHasKey('limit', $subRow);
             $this->assertArrayHasKey('remaining', $subRow);
             $this->assertArrayHasKey('reset', $subRow);
         }
     }
 }