X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Ftwitterapi.php;h=f61ba9b671b58f52049219c8b58c86e797e225c9;hb=08dfd72bad9c4d245cf853e378353da568856724;hp=b8640fa5903e2b99caae0c35bb64f4ebbb5c0493;hpb=902bab5818123a8e8fd6e10c7a49f16d050d2b0c;p=quix0rs-gnu-social.git diff --git a/lib/twitterapi.php b/lib/twitterapi.php index b8640fa590..f61ba9b671 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();