WordPress.org

Plugin Directory

Changeset 735955


Ignore:
Timestamp:
07/04/13 10:22:11 (10 months ago)
Author:
donncha
Message:

Update the Twitter OAuth library from https://github.com/abraham/twitteroauth/tree/master/twitteroauth

Location:
tweet-tweet/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tweet-tweet/trunk/OAuth.php

    r283818 r735955  
    22// vim: foldmethod=marker 
    33 
    4 if (!class_exists('OAuthException')) { 
    5  
    64/* Generic exception class 
    75 */ 
    8 class OAuthException extends Exception { 
    9   // pass 
     6if (!class_exists('OAuthException')) { 
     7  class OAuthException extends Exception { 
     8    // pass 
     9  } 
    1010} 
    1111 
     
    873873  } 
    874874} 
    875  
    876 } // class_exists check 
    877  
    878 ?> 
  • tweet-tweet/trunk/tweet-tweet.php

    r609593 r735955  
    467467    $first = true; 
    468468    foreach ( (array)$tweets as $tweet ) { 
     469        if ( is_object( $tweet ) == false ) 
     470            continue; 
    469471        $tid = $tweet->id_str; 
    470472        $description = $tweet->text; 
  • tweet-tweet/trunk/twitteroauth.php

    r283818 r735955  
    99/* Load OAuth lib. You can find it at http://oauth.net */ 
    1010require_once('OAuth.php'); 
    11  
    12 if (!class_exists('TwitterOAuth')) { 
    1311 
    1412/** 
     
    2119  public $url; 
    2220  /* Set up the API root URL. */ 
    23   public $host = "https://api.twitter.com/1/"; 
     21  public $host = "https://api.twitter.com/1.1/"; 
    2422  /* Set timeout default. */ 
    2523  public $timeout = 30; 
     
    3129  public $format = 'json'; 
    3230  /* Decode returned json data. */ 
    33   public $decode_json = false; 
     31  public $decode_json = TRUE; 
    3432  /* Contains the last HTTP headers returned. */ 
    3533  public $http_info; 
     
    4644   */ 
    4745  function accessTokenURL()  { return 'https://api.twitter.com/oauth/access_token'; } 
    48   function authenticateURL() { return 'https://twitter.com/oauth/authenticate'; } 
    49   function authorizeURL()    { return 'https://twitter.com/oauth/authorize'; } 
     46  function authenticateURL() { return 'https://api.twitter.com/oauth/authenticate'; } 
     47  function authorizeURL()    { return 'https://api.twitter.com/oauth/authorize'; } 
    5048  function requestTokenURL() { return 'https://api.twitter.com/oauth/request_token'; } 
    5149 
     
    7573   * @returns a key/value array containing oauth_token and oauth_token_secret 
    7674   */ 
    77   function getRequestToken($oauth_callback = NULL) { 
     75  function getRequestToken($oauth_callback) { 
    7876    $parameters = array(); 
    79     if (!empty($oauth_callback)) { 
    80       $parameters['oauth_callback'] = $oauth_callback; 
    81     }  
     77    $parameters['oauth_callback'] = $oauth_callback;  
    8278    $request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters); 
    8379    $token = OAuthUtil::parse_parameters($request); 
     
    111107   *                "screen_name" => "abraham") 
    112108   */ 
    113   function getAccessToken($oauth_verifier = FALSE) { 
     109  function getAccessToken($oauth_verifier) { 
    114110    $parameters = array(); 
    115     if (!empty($oauth_verifier)) { 
    116       $parameters['oauth_verifier'] = $oauth_verifier; 
    117     } 
     111    $parameters['oauth_verifier'] = $oauth_verifier; 
    118112    $request = $this->oAuthRequest($this->accessTokenURL(), 'GET', $parameters); 
    119113    $token = OAuthUtil::parse_parameters($request); 
     
    246240  } 
    247241} 
    248  
    249 } // class_exists check 
Note: See TracChangeset for help on using the changeset viewer.