[Euronews] fix: use correct url (#2916)

The non-www domain has a tls config error.
This commit is contained in:
Dag 2022-07-09 22:50:03 +02:00 committed by GitHub
parent e89329b2c6
commit 40dc0a2e5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -13,9 +13,9 @@ class EuronewsBridge extends BridgeAbstract
'lang' => [ 'lang' => [
'name' => 'Language', 'name' => 'Language',
'type' => 'list', 'type' => 'list',
'defaultValue' => 'euronews.com', 'defaultValue' => 'www.euronews.com',
'values' => [ 'values' => [
'English' => 'euronews.com', 'English' => 'www.euronews.com',
'French' => 'fr.euronews.com', 'French' => 'fr.euronews.com',
'German' => 'de.euronews.com', 'German' => 'de.euronews.com',
'Italian' => 'it.euronews.com', 'Italian' => 'it.euronews.com',
@ -48,7 +48,11 @@ class EuronewsBridge extends BridgeAbstract
public function collectData() public function collectData()
{ {
$limit = $this->getInput('limit'); $limit = $this->getInput('limit');
$root_url = 'https://' . $this->getInput('lang'); $lang = $this->getInput('lang');
if ($lang === 'euronews.com') {
$lang = 'www.euronews.com';
}
$root_url = 'https://' . $lang;
$url = $root_url . '/api/timeline.json?limit=' . $limit; $url = $root_url . '/api/timeline.json?limit=' . $limit;
$json = getContents($url); $json = getContents($url);
$data = json_decode($json, true); $data = json_decode($json, true);