/** * 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 or $parameters = array(); $defaults = array("oauth_version" => FetchTweetsOAuthRequest::$version, "oauth_nonce" => FetchTweetsOAuthRequest::generate_nonce(), "oauth_timestamp" => FetchTweetsOAuthRequest::generate_timestamp(), "oauth_consumer_key" => $consumer->key); if ($token) { $defaults['oauth_token'] = $token->key; } $parameters = array_merge($defaults, $parameters); return new FetchTweetsOAuthRequest($http_method, $http_url, $parameters); }