fix(vice): news rss changed (#3694)

* fix: typo in prior commit

* fix(vice): news rss changed
This commit is contained in:
Dag 2023-09-23 20:39:02 +02:00 committed by GitHub
parent bab02bf190
commit 0c69148cff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View file

@ -5,7 +5,7 @@ class ViceBridge extends FeedExpander
const MAINTAINER = 'IceWreck'; const MAINTAINER = 'IceWreck';
const NAME = 'Vice Bridge'; const NAME = 'Vice Bridge';
const URI = 'https://www.vice.com/'; 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 DESCRIPTION = 'RSS feed for vice publications like Vice News, Munchies, Motherboard, etc.';
const PARAMETERS = [ [ const PARAMETERS = [ [
'feed' => [ 'feed' => [
@ -24,6 +24,10 @@ class ViceBridge extends FeedExpander
public function collectData() public function collectData()
{ {
$feed = $this->getInput('feed'); $feed = $this->getInput('feed');
if ($feed === 'rss') {
// They changed url in Sep 2023
$feed = 'en/rss';
}
$feedURL = 'https://www.vice.com/' . $feed; $feedURL = 'https://www.vice.com/' . $feed;
$this->collectExpandableDatas($feedURL, 10); $this->collectExpandableDatas($feedURL, 10);
} }

View file

@ -390,7 +390,7 @@ abstract class XPathAbstract extends BridgeAbstract
* Should provide the feed's items. * Should provide the feed's items.
* *
* @param \DOMXPath $xpath * @param \DOMXPath $xpath
* @return \DOMNodeList * @return \DOMNodeList|false
*/ */
protected function provideFeedItems(\DOMXPath $xpath) protected function provideFeedItems(\DOMXPath $xpath)
{ {
@ -417,6 +417,7 @@ abstract class XPathAbstract extends BridgeAbstract
$entries = $this->provideFeedItems($xpath); $entries = $this->provideFeedItems($xpath);
if ($entries === false) { if ($entries === false) {
// malformed
return; return;
} }

View file

@ -25,7 +25,7 @@
<?php endif; ?> <?php endif; ?>
<?php if ($e->getCode() === 429): ?> <?php if ($e->getCode() === 429): ?>
<h2>429 Try again later</h2> <h2>429 Too Many Requests</h2>
<p> <p>
RSS-Bridge tried to fetch a website. RSS-Bridge tried to fetch a website.
They told us to try again later. They told us to try again later.