diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-07-30 22:15:24 -0400 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-07-30 22:15:24 -0400 |
commit | ec103b90e39c20bfdc2f5663e35eae8b1df212e9 (patch) | |
tree | 426d281c82b7dabaca62bca56da4fd6d5e089976 /actions | |
parent | 80ad02610a428bef62b18e284e15ca847a435cde (diff) |
Implemented the "show" method of the laconica groups api
Diffstat (limited to 'actions')
-rw-r--r-- | actions/api.php | 1 | ||||
-rw-r--r-- | actions/twitapigroups.php | 26 |
2 files changed, 27 insertions, 0 deletions
diff --git a/actions/api.php b/actions/api.php index 8b92889f8..99ab262ad 100644 --- a/actions/api.php +++ b/actions/api.php @@ -130,6 +130,7 @@ class ApiAction extends Action 'laconica/wadl', 'tags/timeline', 'oembed/oembed', + 'groups/show', 'groups/timeline'); static $bareauth = array('statuses/user_timeline', diff --git a/actions/twitapigroups.php b/actions/twitapigroups.php index 71a0776f4..f899bc369 100644 --- a/actions/twitapigroups.php +++ b/actions/twitapigroups.php @@ -51,6 +51,32 @@ require_once INSTALLDIR.'/lib/twitterapi.php'; class TwitapigroupsAction extends TwitterapiAction { + function show($args, $apidata) + { + parent::handle($args); + + common_debug("in groups api action"); + + $this->auth_user = $apidata['user']; + $group = $this->get_group($apidata['api_arg'], $apidata); + + if (empty($group)) { + $this->clientError('Not Found', 404, $apidata['content-type']); + return; + } + + switch($apidata['content-type']) { + case 'xml': + $this->show_single_xml_group($group); + break; + case 'json': + $this->show_single_json_group($group); + break; + default: + $this->clientError(_('API method not found!'), $code = 404); + } + } + function timeline($args, $apidata) { parent::handle($args); |