]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/twitterapi.php
A couple more notice errors
[quix0rs-gnu-social.git] / lib / twitterapi.php
index b8640fa5903e2b99caae0c35bb64f4ebbb5c0493..f61ba9b671b58f52049219c8b58c86e797e225c9 100644 (file)
@@ -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();