mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-01 22:35:21 +03:00
hide dpa articles in Nordbayern News (#3608)
This commit is contained in:
parent
52d3cce59d
commit
11ea6aedfd
1 changed files with 31 additions and 11 deletions
|
@ -44,6 +44,12 @@ class NordbayernBridge extends BridgeAbstract
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'exampleValue' => 'unchecked',
|
'exampleValue' => 'unchecked',
|
||||||
'title' => 'Hide all paywall articles on NN'
|
'title' => 'Hide all paywall articles on NN'
|
||||||
|
],
|
||||||
|
'hideDPA' => [
|
||||||
|
'name' => 'Hide dpa articles',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'exampleValue' => 'unchecked',
|
||||||
|
'title' => 'Hide external articles from dpa'
|
||||||
]
|
]
|
||||||
]];
|
]];
|
||||||
|
|
||||||
|
@ -103,7 +109,7 @@ class NordbayernBridge extends BridgeAbstract
|
||||||
return $teaser;
|
return $teaser;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function handleArticle($link)
|
private function getArticle($link)
|
||||||
{
|
{
|
||||||
$item = [];
|
$item = [];
|
||||||
$article = getSimpleHTMLDOM($link);
|
$article = getSimpleHTMLDOM($link);
|
||||||
|
@ -142,15 +148,9 @@ class NordbayernBridge extends BridgeAbstract
|
||||||
$item['content'] .= self::getUseFullContent($content);
|
$item['content'] .= self::getUseFullContent($content);
|
||||||
}
|
}
|
||||||
|
|
||||||
// exclude police reports if desired
|
|
||||||
if (
|
|
||||||
$this->getInput('policeReports') ||
|
|
||||||
!str_contains($item['content'], 'Hier geht es zu allen aktuellen Polizeimeldungen.')
|
|
||||||
) {
|
|
||||||
$this->items[] = $item;
|
|
||||||
}
|
|
||||||
|
|
||||||
$article->clear();
|
$article->clear();
|
||||||
|
return $item;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function handleNewsblock($listSite)
|
private function handleNewsblock($listSite)
|
||||||
|
@ -161,11 +161,31 @@ class NordbayernBridge extends BridgeAbstract
|
||||||
$url = urljoin(self::URI, $url);
|
$url = urljoin(self::URI, $url);
|
||||||
// exclude nn+ articles if desired
|
// exclude nn+ articles if desired
|
||||||
if (
|
if (
|
||||||
!$this->getInput('hideNNPlus') ||
|
$this->getInput('hideNNPlus') &&
|
||||||
!str_contains($url, 'www.nn.de')
|
str_contains($url, 'www.nn.de')
|
||||||
) {
|
) {
|
||||||
self::handleArticle($url);
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$item = self::getArticle($url);
|
||||||
|
|
||||||
|
// exclude police reports if desired
|
||||||
|
if (
|
||||||
|
!$this->getInput('policeReports') &&
|
||||||
|
str_contains($item['content'], 'Hier geht es zu allen aktuellen Polizeimeldungen.')
|
||||||
|
) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// exclude dpa articles
|
||||||
|
if (
|
||||||
|
$this->getInput('hideDPA') &&
|
||||||
|
str_contains($item['author'], 'dpa')
|
||||||
|
) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->items[] = $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue