summaryrefslogtreecommitdiff
path: root/lib/router.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2009-09-30 10:22:26 -0700
committerZach Copley <zach@status.net>2009-09-30 10:22:26 -0700
commite307adfbfc44e653ee2b5b94dcf7eabdc8ffe0df (patch)
tree7f9752b6a076a13f463370e40cb00844369af6ee /lib/router.php
parentf3820cc85d53c9885744deb76d4b48cd1ec8f7e9 (diff)
New actions for /statuses/friends and /statuses/followers + social graph methods
Diffstat (limited to 'lib/router.php')
-rw-r--r--lib/router.php55
1 files changed, 31 insertions, 24 deletions
diff --git a/lib/router.php b/lib/router.php
index 91cdd2cf8..b3bb240d9 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -314,18 +314,33 @@ class Router
'id' => '[a-zA-Z0-9]+',
'format' => '(xml|json|rss|atom)'));
- $m->connect('api/statuses/home_timeline',
- array('action' => 'apifriendstimeline'));
+ $m->connect('api/statuses/friends.:format',
+ array('action' => 'ApiFriends',
+ 'format' => '(xml|json)'));
+
+ $m->connect('api/statuses/friends/:id.:format',
+ array('action' => 'ApiFriends',
+ 'id' => '[a-zA-Z0-9]+',
+ 'format' => '(xml|json)'));
+
+ $m->connect('api/statuses/followers.:format',
+ array('action' => 'ApiFollowers',
+ 'format' => '(xml|json)'));
+
+ $m->connect('api/statuses/followers/:id.:format',
+ array('action' => 'ApiFollowers',
+ 'id' => '[a-zA-Z0-9]+',
+ 'format' => '(xml|json)'));
$m->connect('api/statuses/:method',
array('action' => 'api',
'apiaction' => 'statuses'),
- array('method' => '(update|show|friends|followers|featured)(\.(atom|rss|xml|json))?'));
+ array('method' => '(update|show|featured)(\.(atom|rss|xml|json))?'));
$m->connect('api/statuses/:method/:argument',
array('action' => 'api',
'apiaction' => 'statuses'),
- array('method' => '(show|destroy|friends|followers)'));
+ array('method' => '(show|destroy)'));
// users
@@ -380,29 +395,21 @@ class Router
// Social graph
- $m->connect('api/friends/ids/:argument',
- array('action' => 'api',
- 'apiaction' => 'statuses',
- 'method' => 'friendsIDs'));
+ $m->connect('api/friends/ids/:id.:format',
+ array('action' => 'apiFriends',
+ 'ids_only' => true));
- foreach (array('xml', 'json') as $e) {
- $m->connect('api/friends/ids.'.$e,
- array('action' => 'api',
- 'apiaction' => 'statuses',
- 'method' => 'friendsIDs.'.$e));
- }
+ $m->connect('api/followers/ids/:id.:format',
+ array('action' => 'apiFollowers',
+ 'ids_only' => true));
- $m->connect('api/followers/ids/:argument',
- array('action' => 'api',
- 'apiaction' => 'statuses',
- 'method' => 'followersIDs'));
+ $m->connect('api/friends/ids.:format',
+ array('action' => 'apiFriends',
+ 'ids_only' => true));
- foreach (array('xml', 'json') as $e) {
- $m->connect('api/followers/ids.'.$e,
- array('action' => 'api',
- 'apiaction' => 'statuses',
- 'method' => 'followersIDs.'.$e));
- }
+ $m->connect('api/followers/ids.:format',
+ array('action' => 'apiFollowers',
+ 'ids_only' => true));
// account