예제 #1
0
 public function getUserInfo()
 {
     // Create a new GET request with the required parameters
     $request = new Resource('GET', 'http://vimeo.com/api/rest/v2?format=json&method=vimeo.people.getInfo', array('oauth_consumer_key' => $this->consumer->client_id, 'oauth_token' => $this->token->access_token));
     // Sign the request using the consumer and token
     $request->sign($this->signature, $this->consumer, $this->token);
     $user = json_decode($request->execute());
     // Create a response from the request
     return array('uid' => $this->token->uid, 'name' => $user->display_name, 'location' => $user->location, 'description' => $user->bio);
 }
예제 #2
0
 public function getUserInfo()
 {
     // Create a new GET request with the required parameters
     $request = new Resource('GET', 'https://api.dropbox.com/1/account/info', array('oauth_consumer_key' => $this->consumer->client_id, 'oauth_token' => $this->token->access_token));
     // Sign the request using the consumer and token
     $request->sign($this->signature, $this->consumer, $this->token);
     $user = json_decode($request->execute());
     // Create a response from the request
     return array('uid' => $this->token->uid, 'name' => $user->display_name, 'email' => $user->email, 'location' => $user->country);
 }
예제 #3
0
 public function getUserInfo()
 {
     // Create a new GET request with the required parameters
     $request = new Resource('GET', 'http://api.flickr.com/services/rest', array('oauth_consumer_key' => $this->consumer->client_id, 'oauth_token' => $this->token->access_token, 'nojsoncallback' => 1, 'format' => 'json', 'method' => 'flickr.test.login'));
     // Sign the request using the consumer and token
     $request->sign($this->signature, $this->consumer, $this->token);
     $response = json_decode($request->execute(), true);
     // Create a response from the request
     return array('uid' => $response['user']['id'], 'name' => $response['user']['username']['_content'], 'nickname' => $response['user']['username']['_content']);
 }
예제 #4
0
 public function getUserInfo()
 {
     // Create a new GET request with the required parameters
     $url = 'https://api.linkedin.com/v1/people/~:(id,first-name,last-name,headline,member-url-resources,picture-url,location,public-profile-url)';
     $request = new Resource('GET', $url, array('oauth_consumer_key' => $this->consumer->client_id, 'oauth_token' => $this->token->access_token));
     // Sign the request using the consumer and token
     $request->sign($this->signature, $this->consumer, $this->token);
     $user = json_decode(json_encode((array) simplexml_load_string($request->execute())), 1);
     // Create a response from the request
     return array('uid' => $user['id'], 'name' => $user['first-name'] . ' ' . $user['last-name'], 'nickname' => end(explode('/', $user['public-profile-url'])), 'description' => $user['headline'], 'location' => isset($user['location']['name']) ? $user['location']['name'] : null, 'urls' => array('Linked In' => $user['public-profile-url']));
 }
예제 #5
0
 public function getUserInfo()
 {
     // Create a new GET request with the required parameters
     $request = new Resource('GET', 'http://api.tumblr.com/v2/user/info', array('oauth_consumer_key' => $this->consumer->client_id, 'oauth_token' => $this->token->access_token));
     // Sign the request using the consumer and token
     $request->sign($this->signature, $this->consumer, $this->token);
     $response = json_decode($request->execute());
     $status = current($response);
     $response = next($response);
     $user = $response->user;
     // Create a response from the request
     return array('uid' => $user->name, 'name' => $user->name, 'likes' => $user->likes, 'following' => $user->following, 'default_post_format' => $user->default_post_format);
 }
예제 #6
0
 public function call($method = 'GET', $url, array $params = array())
 {
     // Create a new GET request with the required parameters
     $request = new ResourceRequest($method, $url, array_merge(array('oauth_consumer_key' => $this->consumer->client_id, 'oauth_token' => $this->token->access_token), $params));
     // Sign the request using the consumer and token
     $request->sign($this->signature, $this->consumer, $this->token);
     return $request->execute();
 }