diff options
author | Zach Copley <zach@status.net> | 2009-10-05 13:50:01 -0700 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2009-10-05 13:50:01 -0700 |
commit | dd0d90723142d8042991f998f2b0c355d47638b5 (patch) | |
tree | 4bb547b03eb5b3846529c0a5cd93a220ad1364b1 /lib/router.php | |
parent | 62d1475df1c85c63f6d0dc4628a912c7666c2d21 (diff) |
New actions for favorites via the API
Diffstat (limited to 'lib/router.php')
-rw-r--r-- | lib/router.php | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/lib/router.php b/lib/router.php index 5ee939657..8e6db8880 100644 --- a/lib/router.php +++ b/lib/router.php @@ -440,22 +440,24 @@ class Router // favorites - $m->connect('api/favorites/:method/:argument', - array('action' => 'api', - 'apiaction' => 'favorites', - array('method' => '(create|destroy)'))); + $m->connect('api/favorites.:format', + array('action' => 'ApiTimelineFavorites', + 'format' => '(xml|json|rss|atom)')); - $m->connect('api/favorites/:argument', - array('action' => 'api', - 'apiaction' => 'favorites', - 'method' => 'favorites')); + $m->connect('api/favorites/:id.:format', + array('action' => 'ApiTimelineFavorites', + 'id' => '[a-zA-Z0-9]+', + 'format' => '(xmljson|rss|atom)')); - foreach (array('xml', 'json', 'rss', 'atom') as $e) { - $m->connect('api/favorites.'.$e, - array('action' => 'api', - 'apiaction' => 'favorites', - 'method' => 'favorites.'.$e)); - } + $m->connect('api/favorites/create/:id.:format', + array('action' => 'ApiFavoriteCreate', + 'id' => '[a-zA-Z0-9]+', + 'format' => '(xml|json)')); + + $m->connect('api/favorites/destroy/:id.:format', + array('action' => 'ApiFavoriteDestroy', + 'id' => '[a-zA-Z0-9]+', + 'format' => '(xml|json)')); // notifications |