You are here

protected function Twitter::get_statuses in Twitter 6.3

Same name and namespace in other branches
  1. 6.5 twitter.lib.php \Twitter::get_statuses()
  2. 7.6 twitter.lib.php \Twitter::get_statuses()
  3. 7.3 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

4 calls to Twitter::get_statuses()
Twitter::friends_timeline in ./twitter.lib.php
Fetch the authenticated user's friends timeline
Twitter::mentions in ./twitter.lib.php
Twitter::public_timeline in ./twitter.lib.php
Fetch the public timeline
Twitter::user_timeline in ./twitter.lib.php
Fetch a user's timeline

File

./twitter.lib.php, line 124
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();
  }
}