part of #6: atom feed for recently updated pastes
[phorkie.git] / www / feed-updated.php
diff --git a/www/feed-updated.php b/www/feed-updated.php
new file mode 100644 (file)
index 0000000..679a5d7
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+/**
+ * Generate an atom feed with the 10 most recently updated pastes
+ */
+namespace phorkie;
+$reqWritePermissions = false;
+require_once 'www-header.php';
+
+$db = new Database();
+header('Content-Type: application/atom+xml');
+render(
+    'feed-updated',
+    array(
+        'pastes'  => $db->getSearch()->listAll(0, 10, 'modate', 'desc'),
+        'url'     => Tools::fullUrl('/'),
+        'feedurl' => Tools::fullUrl('/feed/updated'),
+    )
+);
+?>