diff options
author | Evan Prodromou <evan@status.net> | 2010-09-05 01:07:11 -0400 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-09-07 04:00:59 -0400 |
commit | ba8a24073fc3d545fdc86b613d32b4bfc33743c3 (patch) | |
tree | 1c8892b901e9d4ca4fc18842c4f75e90c0088cdd /plugins/TwitterBridge/twitteroauthclient.php | |
parent | 5944fe57e6e79f635a5fe20b5086aae105797786 (diff) |
Notify Twitter when StatusNet user faves/disfaves a Twitter notice
Diffstat (limited to 'plugins/TwitterBridge/twitteroauthclient.php')
-rw-r--r-- | plugins/TwitterBridge/twitteroauthclient.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/plugins/TwitterBridge/twitteroauthclient.php b/plugins/TwitterBridge/twitteroauthclient.php index 32844a16f..22ccaba07 100644 --- a/plugins/TwitterBridge/twitteroauthclient.php +++ b/plugins/TwitterBridge/twitteroauthclient.php @@ -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; + } } |