aboutsummaryrefslogtreecommitdiffstats
path: root/rss.php
diff options
context:
space:
mode:
Diffstat (limited to 'rss.php')
-rw-r--r--rss.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/rss.php b/rss.php
index 012bf4e..b71a746 100644
--- a/rss.php
+++ b/rss.php
@@ -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>
&bullet;
<time datetime="<?= htmlentities($entry['date']->format(DateTime::ISO8601)) ?>">
<?= htmlentities($entry['date']->format($config['date_fmt'])) ?>