aboutsummaryrefslogtreecommitdiffstats
path: root/library/twitteroauth.php
diff options
context:
space:
mode:
authormrjive <mrjive@mrjive.it>2016-01-03 09:52:37 +0100
committermrjive <mrjive@mrjive.it>2016-01-03 09:52:37 +0100
commit07f5bdde60f55e3b217aee9e33c3175e90a5f0f1 (patch)
tree2b5988c7661c9a5a67f5da8797ca57381e2aad7a /library/twitteroauth.php
parent051346325609f5f2e78ef0deaf182c65d7823bbc (diff)
parent5b0a17359d6b5b3e27219c9e56117f1017996175 (diff)
downloadvolse-hubzilla-07f5bdde60f55e3b217aee9e33c3175e90a5f0f1.tar.gz
volse-hubzilla-07f5bdde60f55e3b217aee9e33c3175e90a5f0f1.tar.bz2
volse-hubzilla-07f5bdde60f55e3b217aee9e33c3175e90a5f0f1.zip
Merge pull request #10 from redmatrix/master
updating from original codebase
Diffstat (limited to 'library/twitteroauth.php')
-rw-r--r--library/twitteroauth.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/library/twitteroauth.php b/library/twitteroauth.php
index a40949534..d6fb1b3a2 100644
--- a/library/twitteroauth.php
+++ b/library/twitteroauth.php
@@ -6,8 +6,8 @@
* The first PHP Library to support OAuth for Twitter's REST API.
*/
-/* Load OAuth lib. You can find it at http://oauth.net */
-if(!class_exists('OAuthException'))
+/* Load OAuth1 lib. You can find it at http://oauth.net */
+if(!class_exists('OAuth1Exception'))
require_once('library/OAuth1.php');
/**
@@ -58,10 +58,10 @@ class TwitterOAuth {
* construct TwitterOAuth object
*/
function __construct($consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL) {
- $this->sha1_method = new OAuthSignatureMethod_HMAC_SHA1();
- $this->consumer = new OAuthConsumer($consumer_key, $consumer_secret);
+ $this->sha1_method = new OAuth1SignatureMethod_HMAC_SHA1();
+ $this->consumer = new OAuth1Consumer($consumer_key, $consumer_secret);
if (!empty($oauth_token) && !empty($oauth_token_secret)) {
- $this->token = new OAuthConsumer($oauth_token, $oauth_token_secret);
+ $this->token = new OAuth1Consumer($oauth_token, $oauth_token_secret);
} else {
$this->token = NULL;
}
@@ -79,8 +79,8 @@ class TwitterOAuth {
$parameters['oauth_callback'] = $oauth_callback;
}
$request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters);
- $token = OAuthUtil::parse_parameters($request);
- $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
+ $token = OAuth1Util::parse_parameters($request);
+ $this->token = new OAuth1Consumer($token['oauth_token'], $token['oauth_token_secret']);
return $token;
}
@@ -115,8 +115,8 @@ class TwitterOAuth {
$parameters['oauth_verifier'] = $oauth_verifier;
}
$request = $this->oAuthRequest($this->accessTokenURL(), 'GET', $parameters);
- $token = OAuthUtil::parse_parameters($request);
- $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
+ $token = OAuth1Util::parse_parameters($request);
+ $this->token = new OAuth1Consumer($token['oauth_token'], $token['oauth_token_secret']);
return $token;
}
@@ -135,8 +135,8 @@ class TwitterOAuth {
$parameters['x_auth_password'] = $password;
$parameters['x_auth_mode'] = 'client_auth';
$request = $this->oAuthRequest($this->accessTokenURL(), 'POST', $parameters);
- $token = OAuthUtil::parse_parameters($request);
- $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
+ $token = OAuth1Util::parse_parameters($request);
+ $this->token = new OAuth1Consumer($token['oauth_token'], $token['oauth_token_secret']);
return $token;
}
@@ -180,7 +180,7 @@ class TwitterOAuth {
if (strrpos($url, 'https://') !== 0 && strrpos($url, 'http://') !== 0) {
$url = "{$this->host}{$url}.{$this->format}";
}
- $request = OAuthRequest::from_consumer_and_token($this->consumer, $this->token, $method, $url, $parameters);
+ $request = OAuth1Request::from_consumer_and_token($this->consumer, $this->token, $method, $url, $parameters);
$request->sign_request($this->sha1_method, $this->consumer, $this->token);
switch ($method) {
case 'GET':