summaryrefslogtreecommitdiff
path: root/changelog/rss.xml
blob: 7a72398a2bd1840f5ac4023207f5e311f25ee694 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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>