Twitter-compatible API - moved show() to the right file

darcs-hash:20080819003931-462f3-4b5b838a2fc5f872391581a189d33abdd8eeb744.gz
This commit is contained in:
zach 2008-08-18 20:39:31 -04:00
parent d57bc1b8e9
commit e440b9cea0
2 changed files with 21 additions and 22 deletions

View File

@ -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();
}
/* /*

View File

@ -151,28 +151,6 @@ class TwitterapiAction extends Action {
print(json_encode($twitter_users)); print(json_encode($twitter_users));
} }
function show($args, $apidata) {
parent::handle($args);
$id = $apidata['api_arg'];
$notice = Notice::staticGet($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();
}
function show_single_xml_status($notice) { function show_single_xml_status($notice) {
$this->init_document('xml'); $this->init_document('xml');
$twitter_status = $this->twitter_status_array($notice); $twitter_status = $this->twitter_status_array($notice);