Slide 60
Slide 60 text
Make API requests
// Create OAuth client object
$o = new OAuth(
MY_CONSUMER_KEY, MY_CONSUMER_SECRET,
OAUTH_SIG_METHOD_HMACSHA1
);
// Sign requests with the access token
$o->setToken(
$current_user->getTwitterToken(),
$current_user->getTwitterSecret()
);
$args = array('status'=>'O HAI TWITTER LOOK AT MAH KITTEH LOL!');
$oauth->fetch(
'https://api.twitter.com/v1/statuses/update.json',
$args,
OAUTH_HTTP_METHOD_POST
);
$json = json_decode($oauth->getLastResponse());
printf("Result: %s\n", print_r($json, true));