hide Nordbayern+ articles (#3094)

This commit is contained in:
Christian Schabesberger 2022-10-08 15:34:26 +02:00 committed by GitHub
parent 0a2e31e1f7
commit 79f6ec5733
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 1 deletions

View File

@ -38,6 +38,12 @@ class NordbayernBridge extends BridgeAbstract
'type' => 'checkbox',
'exampleValue' => 'checked',
'title' => 'Include Police Reports',
],
'hideNNPlus' => [
'name' => 'Hide NN+ articles',
'type' => 'checkbox',
'exampleValue' => 'unchecked',
'title' => 'Hide all paywall articles on NN'
]
]];
@ -153,7 +159,13 @@ class NordbayernBridge extends BridgeAbstract
foreach ($main->find('article') as $article) {
$url = $article->find('a', 0)->href;
$url = urljoin(self::URI, $url);
self::handleArticle($url);
// exclude nn+ articles if desired
if (
!$this->getInput('hideNNPlus') ||
!str_contains($url, 'www.nn.de')
) {
self::handleArticle($url);
}
}
}