Skip to content

Commit

Permalink
[NordbayernBridge] add author & timestamp of article (#2309)
Browse files Browse the repository at this point in the history
  • Loading branch information
eggwhalefrog authored Mar 24, 2022
1 parent 297a6cf commit 3a9e528
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bridges/NordbayernBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -82,6 +82,8 @@ private function handleArticle($link) {
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 {
Expand Down Expand Up @@ -121,7 +123,7 @@ private function handleArticle($link) {
$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;
Expand Down

0 comments on commit 3a9e528

Please sign in to comment.