TijsVerkoyen\Twitter\Twitter::statusesHomeTimeline PHP Метод

statusesHomeTimeline() публичный Метод

This method is identical to statusesFriendsTimeline, except that this method always includes retweets.
public statusesHomeTimeline ( int[optional] $count = null, string[optional] $sinceId = null, string[optional] $maxId = null, bool[optional] $trimUser = null, bool[optional] $excludeReplies = null, bool[optional] $contributorDetails = null, bool[optional] $includeEntities = null ) : array
$count int[optional]
$sinceId string[optional]
$maxId string[optional]
$trimUser bool[optional]
$excludeReplies bool[optional]
$contributorDetails bool[optional]
$includeEntities bool[optional]
Результат array
    public function statusesHomeTimeline($count = null, $sinceId = null, $maxId = null, $trimUser = null, $excludeReplies = null, $contributorDetails = null, $includeEntities = null)
    {
        // build parameters
        $parameters = null;
        if ($count != null) {
            $parameters['count'] = (int) $count;
        }
        if ($sinceId != null) {
            $parameters['since_id'] = (string) $sinceId;
        }
        if ($maxId != null) {
            $parameters['max_id'] = (string) $maxId;
        }
        if ($trimUser !== null) {
            $parameters['trim_user'] = $trimUser ? 'true' : 'false';
        }
        if ($excludeReplies !== null) {
            $parameters['exclude_replies'] = $excludeReplies ? 'true' : 'false';
        }
        if ($contributorDetails !== null) {
            $parameters['contributor_details'] = $contributorDetails ? 'true' : 'false';
        }
        if ($includeEntities !== null) {
            $parameters['include_entities'] = $includeEntities ? 'true' : 'false';
        }
        // make the call
        return $this->doCall('statuses/home_timeline.json', $parameters, true);
    }

Usage Example

Пример #1
0
 /**
  * Tests Twitter->statusesHomeTimeline()
  */
 public function testStatusesHomeTimeline()
 {
     $response = $this->twitter->statusesHomeTimeline(2);
     $this->assertEquals(count($response), 2);
     foreach ($response as $row) {
         $this->isTweet($row);
     }
 }
Twitter