From 8b8e0c95af8efe656c3c7a67153117ba8128456e Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 30 Sep 2009 17:08:52 -0700 Subject: [PATCH] Add route for /statuses/show --- actions/apishow.php | 10 +++++----- lib/router.php | 11 ++++++++++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/actions/apishow.php b/actions/apishow.php index 3d0b7b6e3a..d17cc8c95d 100644 --- a/actions/apishow.php +++ b/actions/apishow.php @@ -83,7 +83,7 @@ class ApiShowAction extends TwitterapiAction /** * Handle the request * - * Just show the notices + * Check the format and show the notice * * @param array $args $_REQUEST data (unused) * @@ -103,7 +103,7 @@ class ApiShowAction extends TwitterapiAction } /** - * Show the timeline of notices + * Show the notice * * @return void */ @@ -125,14 +125,14 @@ class ApiShowAction extends TwitterapiAction if (!empty($deleted)) { $this->clientError( - _('Status deleted.'), - 410, + _('Status deleted.'), + 410, $this->format ); } else { $this->clientError( _('No status with that ID found.'), - 404, + 404, $this->format ); } diff --git a/lib/router.php b/lib/router.php index b3bb240d9a..972db4c9df 100644 --- a/lib/router.php +++ b/lib/router.php @@ -332,10 +332,19 @@ class Router 'id' => '[a-zA-Z0-9]+', 'format' => '(xml|json)')); + $m->connect('api/statuses/show.:format', + array('action' => 'ApiShow', + 'format' => '(xml|json)')); + + $m->connect('api/statuses/show/:id.:format', + array('action' => 'ApiShow', + 'id' => '[a-zA-Z0-9]+', + 'format' => '(xml|json)')); + $m->connect('api/statuses/:method', array('action' => 'api', 'apiaction' => 'statuses'), - array('method' => '(update|show|featured)(\.(atom|rss|xml|json))?')); + array('method' => '(update|featured)(\.(atom|rss|xml|json))?')); $m->connect('api/statuses/:method/:argument', array('action' => 'api',