Advertisement
cgchamila

Untitled

Oct 4th, 2011
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1. <?php
  2. class logme
  3. {
  4. public static function say($msg)
  5. {
  6. openlog("OAUTH-C", 0, LOG_LOCAL0);
  7. syslog(LOG_DEBUG, $msg);
  8. }
  9. }
  10.  
  11. /*echo '<pre>';
  12. echo $_SERVER['HTTP_HOST'] . ' ' . $_SERVER['REQUEST_URI'] . "\n";
  13. echo '</pre>';*/
  14.  
  15. define('OAUTH_CONSUMER_KEY', 'viraj');
  16. define('OAUTH_CONSUMER_SECRET', 'asjh^&556GHJG');
  17.  
  18. try {
  19.     $oauth = new OAuth(OAUTH_CONSUMER_KEY,OAUTH_CONSUMER_SECRET, OAUTH_SIG_METHOD_HMACSHA1);
  20.     $request_token_info = $oauth->getRequestToken("http://localhost:5000/request_token");
  21.  
  22.     if($request_token_info === false) {
  23.     echo 'false returned';
  24.     }
  25.     else if (is_null($request_token_info)) {
  26. echo 'null returned';
  27.     }
  28.  
  29.    if(!empty($request_token_info)) {
  30.        print_r($request_token_info);
  31.    }
  32.    else {
  33.        print "Failed fetching request token, response was: " . $oauth->getLastResponse();
  34.    }
  35.  
  36. }
  37. catch(OAuthException $e) {
  38.    echo urldecode($e->lastResponse) . "\n";
  39. }
  40.  
  41. ?>
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement