[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/externals/httpful/examples/ -> twitter.php (source)

   1  <?php
   2  require (__DIR__ . '/../bootstrap.php');
   3  
   4  $query = urlencode('#PHP');
   5  $response = \Httpful\Request::get("http://search.twitter.com/search.json?q=$query")->send();
   6  
   7  if (!$response->hasErrors()) {
   8      foreach ($response->body->results as $tweet) {
   9          echo "@{$tweet->from_user} tweets \"{$tweet->text}\"\n";
  10      }
  11  } else {
  12      echo "Uh oh.  Twitter gave us the old {$response->code} status.\n";
  13  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1