guestbook/index.xml

27 lines
777 B
XML

<?php
header( "Content-type: text/xml");
echo "<?xml version='1.0' encoding='UTF-8' ?>
<rss version='2.0'>
<channel>
<title>Fbi's Epic Guestbook RSS Feed</title>
<link>https://testing.fbievan.live/guestbook/</link>
<description>A cool Guestbook made by fbievan</description>";
$data = json_decode(file_get_contents('test.json'), true);
$id = 0;
foreach($data as $post) {
$id = $id + 1;
$description = htmlspecialchars($post["message"]);
$title = $post["name"];
$link = "http://testing.fbievan.live/guestbook?link=$id";
echo "
<item>
<title>$title</title>
<description>$description</description>
<link>$link</link>
</item>";
};
echo "
</channel>
</rss>";
?>