diff options
author | aleteoryx <alyx@aleteoryx.me> | 2024-11-12 15:49:19 -0500 |
---|---|---|
committer | aleteoryx <alyx@aleteoryx.me> | 2024-11-12 15:49:19 -0500 |
commit | 8465afea0e9b905279038499479e74fb681d3b83 (patch) | |
tree | 9dd0d0b4ca9b62aca9c52f34c0ffbf1d7bdbc36c /rss.php | |
parent | 433ec701892d4abe2eb3bd65202ce33631bdf5b0 (diff) | |
download | rss_dot_php-8465afea0e9b905279038499479e74fb681d3b83.tar.gz rss_dot_php-8465afea0e9b905279038499479e74fb681d3b83.tar.bz2 rss_dot_php-8465afea0e9b905279038499479e74fb681d3b83.zip |
homepage
Diffstat (limited to 'rss.php')
-rw-r--r-- | rss.php | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -1,9 +1,11 @@ <?php define("VERSION", "0.0.1"); /* --- FEEDS - EDIT AS NEEDED --- */ +$feeds["OTW News"] ["url"] = "https://www.transformativeworks.org/category/announcement/feed/"; +//$feeds["OTW News"] ["home"] = "https://www.transformativeworks.org/"; -$feeds["OTW News"] ["url"] = "https://www.transformativeworks.org/category/announcement/feed/"; -$feeds["Dreamwidth News"]["url"] = "https://dw-news.dreamwidth.org/data/rss"; +$feeds["Dreamwidth News"]["url"] = "https://dw-news.dreamwidth.org/data/rss"; +$feeds["Dreamwidth News"]["home"] = "https://dw-news.dreamwidth.org/"; /* --- CONFIG - EDIT AS NEEDED --- */ @@ -145,6 +147,7 @@ foreach ($feeds as $name => $data) { foreach(load_cached($data["ttl"], $data["url"], $data["linkrel"]) as $entry) { $entry["source"] = $name; + $entry["home"] = @$data["home"]; $combined[] = $entry; } } @@ -196,7 +199,13 @@ $base = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); foreach ($combined as $entry): ?> <article> <h1><a href="<?= htmlentities($entry['link']) ?>"><?= htmlentities($entry['title'] ?? "[[[No Title]]]") ?></a></h1> - <span class="source" data-source="<?= htmlentities($entry['source']) ?>"><?= htmlentities($entry['source']) ?></span> + <span class="source" data-source="<?= htmlentities($entry['source']) ?>"> + <?php if ($entry['home']): ?> + <a href="<?= htmlentities($entry['home']) ?>"><?= htmlentities($entry['source']) ?></a> + <?php else: ?> + <?= htmlentities($entry['source']) ?> + <?php endif; ?> + </span> • <time datetime="<?= htmlentities($entry['date']->format(DateTime::ISO8601)) ?>"> <?= htmlentities($entry['date']->format($config['date_fmt'])) ?> |