+ $tags = get_article_tags($this->link, $line["id"], $owner_uid);
+
+ if (count($tags) > 0) {
+ $article['tags'] = array();
+
+ foreach ($tags as $tag) {
+ array_push($article['tags'], $tag);
+ }
+ }
+
+ $enclosures = get_article_enclosures($this->link, $line["id"]);
+
+ if (count($enclosures) > 0) {
+ $article['enclosures'] = array();
+
+ foreach ($enclosures as $e) {
+ $type = $e['content_type'];
+ $url = $e['content_url'];
+ $length = $e['duration'];
+
+ array_push($article['enclosures'], array("url" => $url, "type" => $type, "length" => $length));
+ }
+ }
+
+ array_push($feed['articles'], $article);
+ }
+
+ header("Content-Type: text/plain; charset=utf-8");
+
+ print json_encode($feed);
+
+ } else {
+ header("Content-Type: text/plain; charset=utf-8");
+ print json_encode(array("error" => array("message" => "Unknown format")));
+ }