diff options
Diffstat (limited to 'changelog/rss.xml')
| -rw-r--r-- | changelog/rss.xml | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/changelog/rss.xml b/changelog/rss.xml new file mode 100644 index 0000000..7a72398 --- /dev/null +++ b/changelog/rss.xml @@ -0,0 +1,30 @@ +<?php +require __DIR__ . '/db.html'; +header("Content-Type: application/rss+xml; charset=UTF-8"); +echo '<?xml version="1.0" encoding="UTF-8"?>'; +?> +<rss version="2.0"> +<channel> +<title>SillyLaird Changelog</title> +<link>https://www.sillylaird.ca/changelog/</link> + +<?php +$stmt = $db->query(" + SELECT title, body, created_at + FROM changelog + ORDER BY created_at DESC + LIMIT 20 +"); +while ($e = $stmt->fetch(PDO::FETCH_ASSOC)): +?> +<item> +<title><?= htmlspecialchars($e['title']) ?></title> +<pubDate><?= date(DATE_RSS, strtotime($e['created_at'])) ?></pubDate> +<description><![CDATA[ +<?= nl2br(htmlspecialchars($e['body'])) ?> +]]></description> +</item> +<?php endwhile; ?> + +</channel> +</rss> |
