From 357998add708431088a02a03a7bd2d00f7549d9b Mon Sep 17 00:00:00 2001 From: Aleteoryx Date: Thu, 14 Nov 2024 19:54:26 -0500 Subject: yahoo mrss media --- rss.php | 46 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/rss.php b/rss.php index 2669085..63fa73e 100644 --- a/rss.php +++ b/rss.php @@ -94,6 +94,16 @@ function load_rss(string $uri, string $linkrel = "alternate", ?bool $allow_html $data["content"] = htmlentities(html_entity_decode($data["content"])); } + foreach($node->getElementsByTagNameNS("http://search.yahoo.com/mrss/", "content") + ->getIterator() as $media) { + $type = $media->getAttribute("type"); + if (str_starts_with($type, "image/")) { + $data["images"][] = htmlentities($media->getAttribute("url")); + } elseif (str_starts_with($type, "video/")) { + $data["videos"][] = htmlentities($media->getAttribute("url")); + } + } + $data["date"] = new DateTime($node->getElementsByTagName("pubDate") ?->item(0)?->textContent ?? '@0'); $data["date"]->setTimezone($config["timezone"]); @@ -244,6 +254,9 @@ foreach ($feeds as $name => $data) { if ($data["mode"] == "no_title") { unset($entry["title"]); } + if (@$data["media"]) { + unset($entry["media"]); + } $combined[] = $entry; } @@ -262,6 +275,7 @@ $base = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); + @@ -273,16 +287,17 @@ $base = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); $query["disabled"][] = $name; $uri = $base."?".http_build_query($query); ?> - + + $data): $query = $_GET; $query["disabled"] = array_filter($query["disabled"], fn($x) => $x !== $name); $uri = $base."?".http_build_query($query); ?> - + @@ -293,27 +308,48 @@ $base = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);

Looks like you filtered out everything...

Try unfiltering some feeds!

-
+
-

+

+
+ + +
+ + + +
+ + + +
+ + + +
+
- + + + Source + •