예제 #1
0
 public function apiExec($method, $apiMethod, array $parameters = array())
 {
     $token = $this->getToken();
     $accessToken = $token->getAccessToken();
     $client = new OAuth1Client($this->consumerKey, $this->consumerSecret, $accessToken[0], $accessToken[1]);
     $url = $this->apiUrl . $apiMethod . '.json';
     $data = $client->exec($method, $url, $parameters);
     $response = json_decode($data, true);
     if ($response === null) {
         return $data;
     }
     return $response;
 }
예제 #2
0
파일: OAuth1.php 프로젝트: veksa/php-social
 protected function execOAuthRequest($method, $url, array $parameters = array())
 {
     $request = new OAuth1Client($this->getConsumerKey(), $this->getConsumerSecret());
     if ($this->requestToken != null) {
         $request->setOAuthToken($this->requestToken['oauth_token'], $this->requestToken['oauth_token_secret']);
     }
     return $request->exec($method, $url, $parameters);
 }