Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class logme
- {
- public static function say($msg)
- {
- openlog("OAUTH-C", 0, LOG_LOCAL0);
- syslog(LOG_DEBUG, $msg);
- }
- }
- /*echo '<pre>';
- echo $_SERVER['HTTP_HOST'] . ' ' . $_SERVER['REQUEST_URI'] . "\n";
- echo '</pre>';*/
- define('OAUTH_CONSUMER_KEY', 'viraj');
- define('OAUTH_CONSUMER_SECRET', 'asjh^&556GHJG');
- try {
- $oauth = new OAuth(OAUTH_CONSUMER_KEY,OAUTH_CONSUMER_SECRET, OAUTH_SIG_METHOD_HMACSHA1);
- $request_token_info = $oauth->getRequestToken("http://localhost:5000/request_token");
- if($request_token_info === false) {
- echo 'false returned';
- }
- else if (is_null($request_token_info)) {
- echo 'null returned';
- }
- if(!empty($request_token_info)) {
- print_r($request_token_info);
- }
- else {
- print "Failed fetching request token, response was: " . $oauth->getLastResponse();
- }
- }
- catch(OAuthException $e) {
- echo urldecode($e->lastResponse) . "\n";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement