From 310d02ae40e0601db6d27c05ef53aedb4767bd4a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 18 Jul 2008 00:34:56 -0400 Subject: init and end documents darcs-hash:20080718043456-84dde-ffe825e8021e0f803fbbecacdc93d26309853daa.gz --- lib/twitterapi.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'lib') diff --git a/lib/twitterapi.php b/lib/twitterapi.php index b8640fa59..f61ba9b67 100644 --- a/lib/twitterapi.php +++ b/lib/twitterapi.php @@ -202,6 +202,48 @@ class TwitterapiAction extends Action { return NULL; } + + function init_document($type='xml') { + switch ($type) { + case 'xml': + header('Content-Type: application/xml; charset=utf-8'); + common_start_xml(); + break; + case 'json': + header('Content-Type: application/json; charset=utf-8'); + break; + case 'rss': + header("Content-Type: application/rss+xml; charset=utf-8"); + $this->init_twitter_rss(); + break; + case 'atom': + header('Content-Type: application/atom+xml; charset=utf-8'); + $this->init_twitter_atom(); + break; + default: + $this->client_error(_('Unsupported type')); + break; + } + } + + function end_document($type='xml') { + switch ($type) { + case 'xml': + common_end_xml(); + break; + case 'json': + break; + case 'rss': + $this->end_twitter_rss(); + break; + case 'atom': + $this->end_twitter_rss(); + break; + default: + $this->client_error(_('Unsupported type')); + break; + } + } function init_twitter_rss() { common_start_xml(); -- cgit v1.2.3-54-g00ecf