]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/TwitterBridge/twitteroauthclient.php
Upgrade Twitter bridge to use OAuth 1.0a. It's more secure, and allows
[quix0rs-gnu-social.git] / plugins / TwitterBridge / twitteroauthclient.php
index 277e7ab409c69b76598e5a72a093274f263c3d49..ba45b533dc9b50fdf4a72075948dadeba14693cd 100644 (file)
@@ -91,6 +91,19 @@ class TwitterOAuthClient extends OAuthClient
         }
     }
 
+    /**
+     * Gets a request token from Twitter
+     *
+     * @return OAuthToken $token the request token
+     */
+    function getRequestToken()
+    {
+        return parent::getRequestToken(
+            self::$requestTokenURL,
+            common_local_url('twitterauthorization')
+        );
+    }
+
     /**
      * Builds a link to Twitter's endpoint for authorizing a request token
      *
@@ -107,6 +120,21 @@ class TwitterOAuthClient extends OAuthClient
                                         common_local_url('twitterauthorization'));
     }
 
+    /**
+     * Fetches an access token from Twitter
+     *
+     * @param string $verifier 1.0a verifier
+     *
+     * @return OAuthToken $token the access token
+     */
+    function getAccessToken($verifier = null)
+    {
+        return parent::getAccessToken(
+            self::$accessTokenURL,
+            $verifier
+        );
+    }
+
     /**
      * Calls Twitter's /account/verify_credentials API method
      *