Skip to content

Commit

Permalink
Fixed favorites methods, removed debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
jdp committed May 24, 2009
1 parent 9e9f38a commit 7951bba
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions twitter.lib.php
Expand Up @@ -357,8 +357,7 @@ function getFavorites($options = array(), $format = 'xml') {
* @return string
*/
function createFavorite($id, $format = 'xml') {
$options = array('id' => $id);
return $this->apiCall('favorites/create', 'post', $format, $options);
return $this->apiCall("favorites/create/{$id}", 'post', $format, array());
}

/**
Expand All @@ -368,8 +367,7 @@ function createFavorite($id, $format = 'xml') {
* @return string
*/
function destroyFavorite($id, $format = 'xml') {
$options = array('id' => $id);
return $this->apiCall('favorites/destroy', 'post', $format, $options);
return $this->apiCall("favorites/destroy/{$id}", 'post', $format, array());
}

/**
Expand Down Expand Up @@ -511,7 +509,7 @@ protected function apiCall($twitter_method, $http_method, $format, $options, $re
if (($http_method == 'get') && (count($options) > 0)) {
$api_url .= '?' . http_build_query($options);
}
echo $api_url . "\n";
//echo $api_url . "\n";
curl_setopt($curl_handle, CURLOPT_URL, $api_url);
if ($require_credentials) {
curl_setopt($curl_handle, CURLOPT_USERPWD, $this->credentials);
Expand Down

0 comments on commit 7951bba

Please sign in to comment.