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; }
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); }