Beispiel #1
0
 private function _request($url, $method, $params)
 {
     $request = OAuthRequest::from_consumer_and_token($this->_consumer, $this->_token, $method, $url, $params);
     $request->sign_request($this->_signatureMethod, $this->_consumer, $this->_token);
     $http = new Twitter_Request();
     $method = strtolower($method);
     switch ($method) {
         case 'get':
             return $http->get($request->to_url());
         default:
             return $http->{$method}($request->get_normalized_http_url(), $request->to_postdata());
     }
 }
Beispiel #2
0
 /**
  * Creates tiny url
  * @param string $url
  * @return string tiny url
  */
 static function create($url)
 {
     $req = new Twitter_Request();
     return $req->get(self::URL, array('url' => $url));
 }