]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apitimelinefriends.php
First cut at some JSON Activity Streams output
[quix0rs-gnu-social.git] / actions / apitimelinefriends.php
index 71049f6eb104407ea5571f85153c10c58baa8c29..3833418baa6cd5c5460b59a204934226386d11b2 100644 (file)
@@ -263,6 +263,12 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
         case 'json':
             $this->showJsonTimeline($this->notices);
             break;
+        case 'as':
+            header('Content-Type: application/json; charset=utf-8');
+            $doc = new ActivityStreamJSONDocument($this->auth_user);
+            $doc->addItemsFromNotices($this->notices);
+            $this->raw($doc->asString());
+            break;
         default:
             // TRANS: Client error displayed when trying to handle an unknown API method.
             $this->clientError(_('API method not found.'), $code = 404);