Skip to content

Instantly share code, notes, and snippets.

@e2kaneko
Created May 4, 2011 13:37
Show Gist options
  • Save e2kaneko/955217 to your computer and use it in GitHub Desktop.
Save e2kaneko/955217 to your computer and use it in GitHub Desktop.
PHP PEARのHTTP/OAuth/ConsumerをTwitter用に改造(username, useridの取得)
<?php
class HTTP_OAuth_Consumer extends HTTP_OAuth
{
protected $userId = null;
protected $screenName = null;
// 略
public function getAccessToken($url, $verifier = '',
array $additional = array(), $method = 'POST'
)
{
// 略
$this->setUserId($data['user_id']);
$this->setScreenName($data['screen_name']);
}
public function getUserId()
{
return $this->userId;
}
public function setUserId($userId)
{
$this->userId = $userId;
}
public function getScreenName()
{
return $this->screenName;
}
public function setScreenName($screenName)
{
$this->screenName = $screenName;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment