summaryrefslogtreecommitdiff
path: root/lib/router.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2009-10-07 17:20:08 -0700
committerZach Copley <zach@status.net>2009-10-07 17:20:08 -0700
commit08de0f1ebdabdce561ce863bdec219a913e61d26 (patch)
treebaf22da1d0dc7060d7674feb253c9c431d619731 /lib/router.php
parent170b009865e3fcb183d562f47d66986b0e397f2d (diff)
New individual actions for dealing with groups via API
Diffstat (limited to 'lib/router.php')
-rw-r--r--lib/router.php65
1 files changed, 48 insertions, 17 deletions
diff --git a/lib/router.php b/lib/router.php
index dbe2be0bb..1ea5885da 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -507,27 +507,58 @@ class Router
'id' => '[a-zA-Z0-9]+',
'format' => '(xmljson|rss|atom)'));
- $m->connect('api/statusnet/groups/list/:argument',
- array('action' => 'api',
- 'method' => 'list_groups',
- 'apiaction' => 'groups'));
+ $m->connect('api/statusnet/groups/show.:format',
+ array('action' => 'ApiGroupShow',
+ 'format' => '(xml|json)'));
- foreach (array('xml', 'json', 'rss', 'atom') as $e) {
- $m->connect('api/statusnet/groups/list.' . $e,
- array('action' => 'api',
- 'method' => 'list_groups.' . $e,
- 'apiaction' => 'groups'));
- }
+ $m->connect('api/statusnet/groups/show/:id.:format',
+ array('action' => 'ApiGroupShow',
+ 'id' => '[a-zA-Z0-9]+',
+ 'format' => '(xml|json)'));
- $m->connect('api/statusnet/groups/:method',
- array('action' => 'api',
- 'apiaction' => 'statuses'),
- array('method' => '(list_all|)(\.(atom|rss|xml|json))?'));
+ $m->connect('api/statusnet/groups/join.:format',
+ array('action' => 'ApiGroupJoin',
+ 'id' => '[a-zA-Z0-9]+',
+ 'format' => '(xml|json)'));
- $m->connect('api/statusnet/groups/:method',
- array('action' => 'api',
- 'apiaction' => 'groups'));
+ $m->connect('api/statusnet/groups/join/:id.:format',
+ array('action' => 'ApiGroupJoin',
+ 'format' => '(xml|json)'));
+
+ $m->connect('api/statusnet/groups/leave.:format',
+ array('action' => 'ApiGroupLeave',
+ 'id' => '[a-zA-Z0-9]+',
+ 'format' => '(xml|json)'));
+ $m->connect('api/statusnet/groups/leave/:id.:format',
+ array('action' => 'ApiGroupLeave',
+ 'format' => '(xml|json)'));
+
+ $m->connect('api/statusnet/groups/is_member.:format',
+ array('action' => 'ApiGroupIsMember',
+ 'format' => '(xml|json)'));
+
+ $m->connect('api/statusnet/groups/list.:format',
+ array('action' => 'ApiGroupList',
+ 'format' => '(xml|json|rss|atom)'));
+
+ $m->connect('api/statusnet/groups/list/:id.:format',
+ array('action' => 'ApiGroupList',
+ 'id' => '[a-zA-Z0-9]+',
+ 'format' => '(xml|json|rss|atom)'));
+
+ $m->connect('api/statusnet/groups/list_all.:format',
+ array('action' => 'ApiGroupListAll',
+ 'format' => '(xml|json|rss|atom)'));
+
+ $m->connect('api/statusnet/groups/membership.:format',
+ array('action' => 'ApiGroupMembership',
+ 'format' => '(xml|json)'));
+
+ $m->connect('api/statusnet/groups/membership/:id.:format',
+ array('action' => 'ApiGroupMembership',
+ 'id' => '[a-zA-Z0-9]+',
+ 'format' => '(xml|json)'));
// Tags
$m->connect('api/statusnet/tags/timeline/:tag.:format',
array('action' => 'ApiTimelineTag',