Notify Twitter when StatusNet user faves/disfaves a Twitter notice

This commit is contained in:
Evan Prodromou
2010-09-05 01:07:11 -04:00
parent 26864d1453
commit 4deea8e2db
2 changed files with 105 additions and 0 deletions

View File

@@ -292,4 +292,36 @@ class TwitterOAuthClient extends OAuthClient
$status = json_decode($response);
return $status;
}
/**
* Calls Twitter's /favorites/create API method
*
* @param int $id ID of the status to favorite
*
* @return object faved status
*/
function favoritesCreate($id)
{
$url = "http://api.twitter.com/1/favorites/create/$id.json";
$response = $this->oAuthPost($url);
$status = json_decode($response);
return $status;
}
/**
* Calls Twitter's /favorites/destroy API method
*
* @param int $id ID of the status to unfavorite
*
* @return object unfaved status
*/
function favoritesDestroy($id)
{
$url = "http://api.twitter.com/1/favorites/destroy/$id.json";
$response = $this->oAuthPost($url);
$status = json_decode($response);
return $status;
}
}