/** * pretty much a helper function to set up the request */ public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = NULL) { $parameters = $parameters ? $parameters : array(); $defaults = array("oauth_version" => Twitter_OAuthRequest::$version, "oauth_nonce" => Twitter_OAuthRequest::generate_nonce(), "oauth_timestamp" => Twitter_OAuthRequest::generate_timestamp(), "oauth_consumer_key" => $consumer->key); if ($token) { $defaults['oauth_token'] = $token->key; } $parameters = array_merge($defaults, $parameters); return new Twitter_OAuthRequest($http_method, $http_url, $parameters); }
/** * pretty much a helper function to set up the request */ public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = NULL) { $defaults = array('oauth_version' => Twitter_OAuthRequest::$version, 'oauth_nonce' => Twitter_OAuthRequest::generate_nonce(), 'oauth_timestamp' => Twitter_OAuthRequest::generate_timestamp(), 'oauth_consumer_key' => $consumer->key); if ($token) { $defaults['oauth_token'] = $token->key; } if (is_array($parameters)) { $defaults += $parameters; } return new Twitter_OAuthRequest($http_method, $http_url, $defaults); }