- Timestamp:
- Jan 22, 2013, 9:01:03 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/oAuth/include/hybridauth/Hybrid/Providers/Tumblr.php
r20293 r20337 32 32 */ 33 33 function getUserProfile() 34 { 35 $response = $this->api->get( 'http://www.tumblr.com/api/authenticate' ); 36 37 // check the last HTTP status code returned 38 if ( $this->api->http_code != 200 ) 39 { 40 throw new Exception( "User profile request failed! {$this->providerId} returned an error: " . $this->errorMessageByStatus( $this->api->http_code ), 6 ); 41 } 42 34 { 43 35 try{ 44 36 $profile = $this->api->get( 'user/info' ); 45 37 46 foreach ( $profile->response->user->blogs as $blog ) 38 foreach ( $profile->response->user->blogs as $blog ){ 47 39 if( $blog->primary ){ 48 40 $bloghostname = explode( '://', $blog->url ); … … 56 48 $this->user->profile->profileURL = $blog->url; 57 49 $this->user->profile->webSiteURL = $blog->url; 50 $this->user->profile->description = strip_tags( $blog->description ); 58 51 59 52 $avatar = $this->api->get( 'blog/'. $this->token( "primary_blog" ) .'/avatar' );
Note: See TracChangeset
for help on using the changeset viewer.