|
@@ 95-104 (lines=10) @@
|
| 92 |
|
* |
| 93 |
|
* @returns a key/value array containing oauth_token and oauth_token_secret |
| 94 |
|
*/ |
| 95 |
|
public function getRequestToken($oauth_callback) |
| 96 |
|
{ |
| 97 |
|
$parameters = []; |
| 98 |
|
$parameters['oauth_callback'] = $oauth_callback; |
| 99 |
|
$request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters); |
| 100 |
|
$token = OAuthUtil::parse_parameters($request); |
| 101 |
|
$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']); |
| 102 |
|
|
| 103 |
|
return $token; |
| 104 |
|
} |
| 105 |
|
|
| 106 |
|
/** |
| 107 |
|
* Get the authorize URL. |
|
@@ 132-141 (lines=10) @@
|
| 129 |
|
* "user_id" => "9436992", |
| 130 |
|
* "screen_name" => "abraham") |
| 131 |
|
*/ |
| 132 |
|
public function getAccessToken($oauth_verifier) |
| 133 |
|
{ |
| 134 |
|
$parameters = []; |
| 135 |
|
$parameters['oauth_verifier'] = $oauth_verifier; |
| 136 |
|
$request = $this->oAuthRequest($this->accessTokenURL(), 'GET', $parameters); |
| 137 |
|
$token = OAuthUtil::parse_parameters($request); |
| 138 |
|
$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']); |
| 139 |
|
|
| 140 |
|
return $token; |
| 141 |
|
} |
| 142 |
|
|
| 143 |
|
/** |
| 144 |
|
* One time exchange of username and password for access token and secret. |