aboutsummaryrefslogtreecommitdiff
path: root/app/views/helpers/export/opml.phtml
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/helpers/export/opml.phtml')
-rw-r--r--app/views/helpers/export/opml.phtml28
1 files changed, 28 insertions, 0 deletions
diff --git a/app/views/helpers/export/opml.phtml b/app/views/helpers/export/opml.phtml
new file mode 100644
index 000000000..8622d9144
--- /dev/null
+++ b/app/views/helpers/export/opml.phtml
@@ -0,0 +1,28 @@
+<?php
+
+$opml_array = array(
+ 'head' => array(
+ 'title' => Minz_Configuration::title(),
+ 'dateCreated' => date('D, d M Y H:i:s')
+ ),
+ 'body' => array()
+);
+
+foreach ($this->categories as $key => $cat) {
+ $opml_array['body'][$key] = array(
+ 'text' => $cat['name'],
+ '@outlines' => array()
+ );
+
+ foreach ($cat['feeds'] as $feed) {
+ $opml_array['body'][$key]['@outlines'][] = array(
+ 'text' => htmlspecialchars_decode($feed->name()),
+ 'type' => 'rss',
+ 'xmlUrl' => htmlspecialchars_decode($feed->url()),
+ 'htmlUrl' => htmlspecialchars_decode($feed->website()),
+ 'description' => htmlspecialchars_decode($feed->description()),
+ );
+ }
+}
+
+echo libopml_render($opml_array);