Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
CustomTwitterService.php
1 <?php
2 /**
3  * An example of extending the provider class.
4  *
5  * @author Maxim Zemskov <nodge@yandex.ru>
6  * @link http://code.google.com/p/yii-eauth/
7  * @license http://www.opensource.org/licenses/bsd-license.php
8  */
9 
10 require_once dirname(dirname(__FILE__)) . '/services/TwitterOAuthService.php';
11 
13 
14  protected function fetchAttributes() {
15  $info = $this->makeSignedRequest('https://api.twitter.com/1/account/verify_credentials.json');
16 
17  $this->attributes['id'] = $info->id;
18  $this->attributes['name'] = $info->name;
19  $this->attributes['url'] = 'http://twitter.com/account/redirect_by_id?id='.$info->id_str;
20 
21  $this->attributes['username'] = $info->screen_name;
22  $this->attributes['language'] = $info->lang;
23  $this->attributes['timezone'] = timezone_name_from_abbr('', $info->utc_offset, date('I'));
24  $this->attributes['photo'] = $info->profile_image_url;
25  }
26 }