TijsVerkoyen\Twitter\Twitter::statusesRetweets PHP Method

statusesRetweets() public method

Returns up to 100 of the first retweets of a given tweet.
public statusesRetweets ( string $id, int[optional] $count = null, bool[optional] $trimUser = null ) : array
$id string The numerical ID of the desired status.
$count int[optional]
$trimUser bool[optional]
return array
    public function statusesRetweets($id, $count = null, $trimUser = null)
    {
        // build parameters
        $parameters = null;
        if ($count != null) {
            $parameters['count'] = (int) $count;
        }
        if ($trimUser !== null) {
            $parameters['trim_user'] = $trimUser ? 'true' : 'false';
        }
        // make the call
        return $this->doCall('statuses/retweets/' . (string) $id . '.json', $parameters);
    }

Usage Example

Beispiel #1
0
 /**
  * Tests Twitter->statusesRetweets()
  */
 public function testStatusesRetweets()
 {
     $response = $this->twitter->statusesRetweets('21947795900469248', 2);
     $this->assertEquals(count($response), 2);
     foreach ($response as $row) {
         $this->isTweet($row);
     }
 }
Twitter