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

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,9 +159,15 @@ class NordbayernBridge extends BridgeAbstract
foreach ($main->find('article') as $article) {
$url = $article->find('a', 0)->href;
$url = urljoin(self::URI, $url);
// exclude nn+ articles if desired
if (
!$this->getInput('hideNNPlus') ||
!str_contains($url, 'www.nn.de')
) {
self::handleArticle($url);
}
}
}
public function collectData()
{