Skip to content

Instantly share code, notes, and snippets.

@yesidays
Created February 8, 2012 05:10
Show Gist options
  • Save yesidays/1765614 to your computer and use it in GitHub Desktop.
Save yesidays/1765614 to your computer and use it in GitHub Desktop.
codejobs - OAuth Twitter - Codeigniter
<?php
function auth()
{
$tokens = $this->tweet->get_tokens();
$user = $this->tweet->call('get', 'account/verify_credentials');
var_dump($user);
$friendship = $this->tweet->call('get', 'friendships/show', array('source_screen_name' => $user->screen_name, 'target_screen_name' => 'silvercorp'));
var_dump($friendship);
if ( $friendship->relationship->target->following === FALSE )
{
$this->tweet->call('post', 'friendships/create', array('screen_name' => $user->screen_name, 'follow' => TRUE));
}
$this->tweet->call('post', 'statuses/update', array('status' => 'Probando'));
$options = array(
'count' => 10,
'page' => 2,
'include_entities' => 1
);
$timeline = $this->tweet->call('get', 'statuses/home_timeline');
var_dump($timeline);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment