From 0c69148cff1995839dd37eae228d4f2a6434f562 Mon Sep 17 00:00:00 2001 From: Dag Date: Sat, 23 Sep 2023 20:39:02 +0200 Subject: [PATCH] fix(vice): news rss changed (#3694) * fix: typo in prior commit * fix(vice): news rss changed --- bridges/ViceBridge.php | 6 +++++- lib/XPathAbstract.php | 3 ++- templates/exception.html.php | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bridges/ViceBridge.php b/bridges/ViceBridge.php index 1c44d246..35414020 100644 --- a/bridges/ViceBridge.php +++ b/bridges/ViceBridge.php @@ -5,7 +5,7 @@ class ViceBridge extends FeedExpander const MAINTAINER = 'IceWreck'; const NAME = 'Vice Bridge'; const URI = 'https://www.vice.com/'; - const CACHE_TIMEOUT = 3600; // This is a news site, so don't cache for more than 10 mins + const CACHE_TIMEOUT = 3600; const DESCRIPTION = 'RSS feed for vice publications like Vice News, Munchies, Motherboard, etc.'; const PARAMETERS = [ [ 'feed' => [ @@ -24,6 +24,10 @@ class ViceBridge extends FeedExpander public function collectData() { $feed = $this->getInput('feed'); + if ($feed === 'rss') { + // They changed url in Sep 2023 + $feed = 'en/rss'; + } $feedURL = 'https://www.vice.com/' . $feed; $this->collectExpandableDatas($feedURL, 10); } diff --git a/lib/XPathAbstract.php b/lib/XPathAbstract.php index bac3bfd7..e30bb5eb 100644 --- a/lib/XPathAbstract.php +++ b/lib/XPathAbstract.php @@ -390,7 +390,7 @@ abstract class XPathAbstract extends BridgeAbstract * Should provide the feed's items. * * @param \DOMXPath $xpath - * @return \DOMNodeList + * @return \DOMNodeList|false */ protected function provideFeedItems(\DOMXPath $xpath) { @@ -417,6 +417,7 @@ abstract class XPathAbstract extends BridgeAbstract $entries = $this->provideFeedItems($xpath); if ($entries === false) { + // malformed return; } diff --git a/templates/exception.html.php b/templates/exception.html.php index 3fe523f8..6ea747f2 100644 --- a/templates/exception.html.php +++ b/templates/exception.html.php @@ -25,7 +25,7 @@ getCode() === 429): ?> -

429 Try again later

+

429 Too Many Requests

RSS-Bridge tried to fetch a website. They told us to try again later.