[VideoCardzBridge] category name and url fixes (#3447)

* [VideoCardzBridge] category name and url fixes

* [VideoCardzBridge] error fixes

* [VideoCardzBridge] formatting fix

* [VideoCardzBridge] cache timeout removal
This commit is contained in:
rmscoelho 2023-06-20 14:01:41 +01:00 committed by GitHub
parent 60be4cdebd
commit 1d3888f22a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 10 deletions

View File

@ -6,7 +6,6 @@ class VideoCardzBridge extends BridgeAbstract
const URI = 'https://videocardz.com/'; const URI = 'https://videocardz.com/';
const DESCRIPTION = 'Returns news from VideoCardz.com'; const DESCRIPTION = 'Returns news from VideoCardz.com';
const MAINTAINER = 'rmscoelho'; const MAINTAINER = 'rmscoelho';
const CACHE_TIMEOUT = 300;
const PARAMETERS = [ const PARAMETERS = [
[ [
'feed' => [ 'feed' => [
@ -16,7 +15,7 @@ class VideoCardzBridge extends BridgeAbstract
'values' => [ 'values' => [
'News' => 'sections/news', 'News' => 'sections/news',
'Featured' => 'sections/featured', 'Featured' => 'sections/featured',
'Leak' => 'sections/leak', 'Leaks' => 'sections/leaks',
'Press Releases' => 'sections/press-releases', 'Press Releases' => 'sections/press-releases',
'Preview Roundup' => 'sections/review-roundup', 'Preview Roundup' => 'sections/review-roundup',
'Rumour' => 'sections/rumor', 'Rumour' => 'sections/rumor',
@ -30,16 +29,26 @@ class VideoCardzBridge extends BridgeAbstract
return 'https://videocardz.com/favicon-32x32.png?x66580'; return 'https://videocardz.com/favicon-32x32.png?x66580';
} }
public function getName()
{
$feed = $this->getInput('feed');
if ($this->getInput('feed') !== null && $this->getInput('feed') !== '') {
$feed = explode('/', $feed);
$feed = $feed[1];
if (str_contains($feed, '-')) {
$feed = explode('-', $feed);
$word1 = $feed[0];
$word2 = $feed[1];
$feed = ucfirst($word1) . ' ' . ucfirst($word2);
}
return self::NAME . ' | ' . ucfirst($feed);
}
return self::NAME;
}
public function getURI() public function getURI()
{ {
switch ($this->queriedContext) { return self::URI . $this->getInput('feed');
case 'feed':
$url = self::URI . $this->getInput('feed');
break;
default:
$url = self::URI;
}
return $url;
} }
public function collectData() public function collectData()