diff options
| author | Hannah Isopod <me@bathynomus.xyz> | 2025-05-10 03:03:58 -0600 |
|---|---|---|
| committer | Hannah Isopod <me@bathynomus.xyz> | 2025-05-10 03:03:58 -0600 |
| commit | eb61c1bae2ffad114e17393d91d86fb00d7ac8cd (patch) | |
| tree | 4f997d73e0843dab760e5d988679a1a86b76f5da /blog/comment/feed.php | |
| parent | 4b9500ddeedbea21f80f41dfe4149cf3bf9be4c3 (diff) | |
Initialer commit
Just remade the repo because I don't *need* need a comprehensive source history for my personal website and this is easier than getting filter-repo to work good
Diffstat (limited to 'blog/comment/feed.php')
| -rw-r--r-- | blog/comment/feed.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/blog/comment/feed.php b/blog/comment/feed.php new file mode 100644 index 0000000..889514f --- /dev/null +++ b/blog/comment/feed.php @@ -0,0 +1,29 @@ +<?php +include("../../Parsedown.php"); +$Parsedown = new Parsedown(); +$Parsedown->setSafeMode(true); + +header('Content-Type: text/xml'); + +echo '<rss version="2.0"><channel>'; +echo '<title>isopod.cool blog comments</title>'; +echo '<description>Every comment posted on my blog in chronological order.</description>'; +echo '<language>en-us</language>'; +echo '<link>https://isopod.cool/blog/comment/</link>'; +echo '<generator>My crappy PHP code</generator>'; + +$postlist = json_decode(file_get_contents("posts.json")); +$totaloutput = ""; +foreach($postlist as $post) { + $output = ""; + $date = date("D, d M Y H:m:s", $post->date) . " GMT"; + $name = $post->name; + $message = $Parsedown->text(html_entity_decode($post->message)); + $entry = $post->entry; + + $output = $output."Comment from ".$name." on ".$entry.":<br><br>".$message."<br><br>"; + $totaloutput = "<item><title>Comment on " . $entry . " from " . $name . "</title><link>https://isopod.cool/blog/posts/" . $entry . "/</link><pubDate>" . $date . "</pubDate><description>".htmlentities($output)."</description><guid isPermaLink='false'>" . $entry . $post->date . $name . "</guid></item>".$totaloutput; +} + +echo $totaloutput; +echo "</channel></rss>";
\ No newline at end of file |
