Ignore:
Timestamp:
Jan 22, 2013, 9:01:03 PM (11 years ago)
Author:
mistic100
Message:

fixed: cannot create initial config, update Tumblr adapter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/oAuth/include/hybridauth/Hybrid/Providers/Tumblr.php

    r20293 r20337  
    3232        */
    3333        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        {
    4335                try{ 
    4436                        $profile = $this->api->get( 'user/info' );
    4537
    46                         foreach ( $profile->response->user->blogs as $blog ) {
     38                        foreach ( $profile->response->user->blogs as $blog ){
    4739                                if( $blog->primary ){
    4840                                        $bloghostname = explode( '://', $blog->url );
     
    5648                                        $this->user->profile->profileURL        = $blog->url;
    5749                                        $this->user->profile->webSiteURL        = $blog->url;
     50                                        $this->user->profile->description       = strip_tags( $blog->description );
    5851
    5952                                        $avatar = $this->api->get( 'blog/'. $this->token( "primary_blog" ) .'/avatar' );
Note: See TracChangeset for help on using the changeset viewer.