summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2009-09-30 17:08:52 -0700
committerZach Copley <zach@status.net>2009-09-30 17:08:52 -0700
commit8b8e0c95af8efe656c3c7a67153117ba8128456e (patch)
tree1256f16667947299da5f934884e2de8d4764fa46
parenta3901e0e243d42fb75162a063c10b77fddd7dfe5 (diff)
Add route for /statuses/show
-rw-r--r--actions/apishow.php10
-rw-r--r--lib/router.php11
2 files changed, 15 insertions, 6 deletions
diff --git a/actions/apishow.php b/actions/apishow.php
index 3d0b7b6e3..d17cc8c95 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 b3bb240d9..972db4c9d 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',