public function post()
 {
     $token = Session::read('oauth.access');
     $result = Consumer::post('/1/statuses/update.json', array('status' => 'Testing my status'), compact('token'));
     echo $result;
     exit;
 }
 public function login()
 {
     $token = Session::read('oauth.request');
     if (empty($token)) {
         $this->redirect('Client::authorize');
     }
     $this->redirect(Consumer::authenticate($token));
 }
示例#3
0
 public function testPost()
 {
     $expected = '{"test":"cool"}';
     $token = array('oauth_token' => 'requestkey', 'oauth_token_secret' => 'requestsecret');
     Consumer::config(array('classes' => array('socket' => '\\li3_oauth\\tests\\mocks\\extensions\\service\\MockSocket')));
     $result = Consumer::post('search', array(), compact('token'));
     $this->assertEqual($expected, $result);
 }
示例#4
0
 public function login()
 {
     Session::delete('oauth.request');
     Session::delete('oauth.access');
     $token = Consumer::token('request', array('params' => array('oauth_callback' => 'http://local.moodpik.com/tweet/success')));
     Session::write('oauth.request', $token);
     if (empty($token)) {
         $this->redirect('Tweet::authorize');
     }
     $this->redirect(Consumer::authenticate($token));
 }