]> git.quilime.com - clmpr.git/commitdiff
Updated RSS method so XML type can be used
authorGabriel Dunne <gdunne@quilime.com>
Fri, 16 Dec 2011 23:54:09 +0000 (15:54 -0800)
committerGabriel Dunne <gdunne@quilime.com>
Fri, 16 Dec 2011 23:54:09 +0000 (15:54 -0800)
get.php
index.php
rss.php

diff --git a/get.php b/get.php
index 2355c0d413a1b1da81f63cdf722bd30287c7b011..4de5fce1853d69500ccfe2168644c57894a7fd6b 100644 (file)
--- a/get.php
+++ b/get.php
@@ -30,6 +30,7 @@
 
 
     switch ($format) {
+    case 'xml' :
         case 'rss' :
             include 'rss.php';
             exit;
index 2c999a45dce793ba8f230c5ad20f9e3254329481..c48a293e30ea4099217607a8ab625807ab9e258a 100644 (file)
--- a/index.php
+++ b/index.php
@@ -38,6 +38,7 @@
 
     switch ($format) {
         case 'rss' :
+        case 'xml' :
             include 'get.php';
             exit;
     }
diff --git a/rss.php b/rss.php
index 1fd79fa826317fcb412296e277ea3035312cd340..4d5c696c01b72625a88dd4b0913dd3b87166367b 100644 (file)
--- a/rss.php
+++ b/rss.php
@@ -1,8 +1,32 @@
 <?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
 <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/">
-
 <channel>
 
+       <title>clmpr.com <?php echo $endpoint ?></title>
+       <link>http://www.clmpr.com/</link>
+       <description></description>
+       <title>Citation, Logging and Multi-Purpose aRchive</title>
+
+       <?php for($i = 0; $row = $q->fetch(); $i++ ): ?>
+       <item>
+           <title><?php echo urlencode($row['title']) ?></title>
+           <link><?php echo urlencode($row['location']) ?></link>
+           <pubDate><?php echo date('r', strtotime($row['date'])); ?></pubDate>
+
+       </item> 
+
+       <?php endfor; ?>
+
+</channel>
+</rss>
+
+<?php
+
+exit;
+
+/*
+
+
 <title>clmpr.com <?php echo $endpoint ?></title>
 <link>http://www.clmpr.com/</link>
 <description></description>
@@ -22,5 +46,4 @@
 
 <?php endfor; ?>
 
-</channel>
-</rss>
\ No newline at end of file
+*/
\ No newline at end of file