From e440b9cea02549032ba4f79c43964219dea23d82 Mon Sep 17 00:00:00 2001 From: zach Date: Mon, 18 Aug 2008 20:39:31 -0400 Subject: Twitter-compatible API - moved show() to the right file darcs-hash:20080819003931-462f3-4b5b838a2fc5f872391581a189d33abdd8eeb744.gz --- actions/twitapistatuses.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'actions/twitapistatuses.php') diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php index 6a63dd037..66d3737fd 100644 --- a/actions/twitapistatuses.php +++ b/actions/twitapistatuses.php @@ -530,6 +530,27 @@ class TwitapistatusesAction extends TwitterapiAction { } + function show($args, $apidata) { + parent::handle($args); + + $notice_id = $apidata['api_arg']; + $notice = Notice::staticGet($notice_id); + + if ($notice) { + if ($apidata['content-type'] == 'xml') { + $this->show_single_xml_status($notice); + } elseif ($apidata['content-type'] == 'json') { + $this->show_single_json_status($notice); + } + } else { + + // XXX: This is all that Twitter does. It doesn't show an XML or JSON error msg. + // Should we call client_error() to be more consistent? + header('HTTP/1.1 404 Not Found'); + } + + exit(); + } /* -- cgit v1.2.3-54-g00ecf