[NordbayernBridge] add author & timestamp of article (#2309)

This commit is contained in:
eggwhalefrog 2022-03-25 00:28:06 +01:00 committed by GitHub
parent 297a6cf191
commit 3a9e528301
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@ class NordbayernBridge extends BridgeAbstract {
const NAME = 'Nordbayern';
const CACHE_TIMEOUT = 3600;
const URI = 'https://www.nordbayern.de';
const DESCRIPTION = 'Bridge for Bavarian reginoal news site nordbayern.de';
const DESCRIPTION = 'Bridge for Bavarian regional news site nordbayern.de';
const PARAMETERS = array( array(
'region' => array(
'name' => 'region',
@ -82,6 +82,8 @@ class NordbayernBridge extends BridgeAbstract {
defaultLinkTo($article, self::URI);
$item['uri'] = $link;
$item['author'] = $article->find('[class=article__author extrabold]', 0)->plaintext;
$item['timestamp'] = strtotime(str_replace('Uhr','', $article->find('[class=article__release]',0)->plaintext));
if ($article->find('h2', 0) == null) {
$item['title'] = $article->find('h3', 0)->innertext;
} else {
@ -121,7 +123,7 @@ class NordbayernBridge extends BridgeAbstract {
$item['content'] .= '<img src="' . $images[$i] . '">';
}
// exclude police reports if descired
// exclude police reports if desired
if($this->getInput('policeReports') ||
!str_contains($item['content'], 'Hier geht es zu allen aktuellen Polizeimeldungen.')) {
$this->items[] = $item;