Skip to content

Instantly share code, notes, and snippets.

@dotcomboom
Created January 16, 2026 04:28
Show Gist options
  • Select an option

  • Save dotcomboom/e467befac034bd2cfa2cfbc3eae769ae to your computer and use it in GitHub Desktop.

Select an option

Save dotcomboom/e467befac034bd2cfa2cfbc3eae769ae to your computer and use it in GitHub Desktop.
dcb.somnol Updates RSS
<?php
header("Content-type: text/xml");
/* ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL); */
echo "<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
<channel>
<title>Updates - dotcomboom</title>
<link>https://dotcomboom.somnolescent.net/updates</link>
<description>What's new at dotcomboom.somnolescent.net</description>
<language>en-us</language>";
$dom = new DOMDocument();
$dom->loadHTMLFile("index.html");
$articles = $dom->getElementsByTagName('article');
$dates = $dom->getElementsByTagName('h4');
/* echo "<debug>" . count($articles) . " articles, " . count($dates) . " dates</debug>"; */
foreach ($articles as $i => $article) {
$parsed = date_create($dates[$i]->nodeValue);
echo "<item>
<title>" . $dates[$i]->nodeValue . "</title>
<pubDate>" . date('r', date_timestamp_get($parsed)) . "</pubDate>
<link>https://dotcomboom.somnolescent.net/updates/</link>
<description>";
echo $article->nodeValue;
echo "</description></item>";
}
echo "</channel></rss>";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment