You are here

public function Twitter::user_timeline in Twitter 7.6

Same name and namespace in other branches
  1. 6.5 twitter.lib.php \Twitter::user_timeline()
  2. 6.3 twitter.lib.php \Twitter::user_timeline()
  3. 7.3 twitter.lib.php \Twitter::user_timeline()
  4. 7.5 twitter.lib.php \Twitter::user_timeline()

Fetch a user's timeline

Returns a collection of the most recent Tweets posted by the user indicated by the screen_name or user_id parameters.

Parameters

mixed $id: either a Twitter user_id or a Twitter screen_name.

array $params: an array of parameters.

See also

https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline

File

./twitter.lib.php, line 342
Integration layer to communicate with the Twitter REST API 1.1. https://dev.twitter.com/docs/api/1.1

Class

Twitter
Primary Twitter API implementation class

Code

public function user_timeline($id, $params = array()) {
  if (is_numeric($id)) {
    $params['user_id'] = $id;
  }
  else {
    $params['screen_name'] = $id;
  }
  return $this
    ->get_statuses('statuses/user_timeline', $params);
}