You are here

protected function Twitter::get_statuses in Twitter 7.3

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

Get an array of TwitterStatus objects from an API endpoint

2 calls to Twitter::get_statuses()
Twitter::mentions in ./twitter.lib.php
Twitter::user_timeline in ./twitter.lib.php
Fetch a user's timeline

File

./twitter.lib.php, line 73
Classes to implement the full Twitter API

Class

Twitter
Primary Twitter API implementation class Supports the full REST API for twitter.

Code

protected function get_statuses($path, $params = array(), $use_auth = FALSE) {
  $values = $this
    ->call($path, $params, 'GET', $use_auth);

  // Check on successfull call
  if ($values) {
    $statuses = array();
    foreach ($values as $status) {
      $statuses[] = new TwitterStatus($status);
    }
    return $statuses;
  }
  else {

    // As call allready throws an exception, we can return an empty array to
    // break no code.
    return array();
  }
}