Example #1
0
 public function getProfile()
 {
     $path = '/people/~:(id,first-name,last-name,maiden-name,public-profile-url,formatted-name,num-connections,email-address,num-recommenders)?format=json';
     $result = $this->request($path);
     $json_result = json_decode($result, true);
     $mapping = ['id' => 'id', 'email' => 'emailAddress', 'name' => 'formattedName', 'first_name' => 'firstName', 'middle_name' => 'maidenName', 'last_name' => 'lastName', 'link' => 'publicProfileUrl', 'likes' => 'numConnections'];
     $profile = Profile::create($mapping, $json_result);
     $profile->provider = static::$provider;
     $profile->raw_response = $result;
     return $profile;
 }
Example #2
0
 public function getProfile()
 {
     $path = 'user/info';
     $result = $this->request($path);
     $profile_json = json_decode($result, true);
     $mapping = ['id' => 'name', 'name' => 'name', 'username' => 'name', 'likes' => 'likes'];
     $profile = Profile::create($mapping, $profile_json['response']['user']);
     $profile->provider = static::$provider;
     $profile->raw_response = $result;
     $profile->link = 'https://www.tumblr.com';
     return $profile;
 }
Example #3
0
 public function getProfile()
 {
     if (is_null($this->profile)) {
         $path = '/me';
         $result = $this->request($path);
         $json_result = json_decode($result, true);
         $mapping = ['id' => 'id', 'email' => 'email', 'name' => 'name', 'first_name' => 'first_name', 'middle_name' => 'middle_name', 'last_name' => 'last_name', 'username' => 'username', 'link' => 'link'];
         $this->profile = Profile::create($mapping, $json_result);
         $this->profile->provider = static::$provider;
         $this->profile->raw_response = $result;
     }
     return $this->profile;
 }
Example #4
0
 public function getProfile()
 {
     $path = '/account/verify_credentials.json?skip_status=1';
     $result = $this->request($path);
     $profile_json = json_decode($result, true);
     $mapping = ['id' => 'id_str', 'name' => 'name', 'first_name' => 'first_name', 'middle_name' => 'middle_name', 'last_name' => 'last_name', 'username' => 'screen_name', 'link' => 'link'];
     $profile = Profile::create($mapping, $profile_json);
     $profile->provider = static::$provider;
     $profile->raw_response = $result;
     $profile->link = 'https://twitter.com/' . $profile_json['screen_name'];
     return $profile;
 }