1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-05 05:02:44 +01:00
phorge-phorge/externals/httpful/examples/twitter.php
epriestley 23786784ef Add Balanced Payments API
Summary: Adds the Balanced PHP API to externals/. Ref T2787.

Test Plan: Used in next diff.

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran, aurelijus

Maniphest Tasks: T2787

Differential Revision: https://secure.phabricator.com/D5764
2013-04-25 09:47:30 -07:00

13 lines
405 B
PHP

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