From fd8fe9023dd28190a2e8b726f6066139ed8c8686 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Sat, 21 Aug 2021 00:14:00 +0200 Subject: [PATCH] fix election articles for nordbayern --- bridges/NordbayernBridge.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/bridges/NordbayernBridge.php b/bridges/NordbayernBridge.php index 2b9f6172415..6aa2d5a9a9b 100644 --- a/bridges/NordbayernBridge.php +++ b/bridges/NordbayernBridge.php @@ -78,7 +78,11 @@ private function handleArticle($link) { defaultLinkTo($article, self::URI); $item['uri'] = $link; - $item['title'] = $article->find('h2', 0)->innertext; + if ($article->find('h2', 0) == null) { + $item['title'] = $article->find('h3', 0)->innertext; + } else { + $item['title'] = $article->find('h2', 0)->innertext; + } $item['content'] = ''; //first get images from content @@ -88,9 +92,15 @@ private function handleArticle($link) { $item['content'] .= ''; } - $content = $article->find('section[class*=article__richtext]', 0) + if ($article->find('section[class*=article__richtext]', 0) == null) { + $content = $article->find('div[class*=modul__teaser]', 0) + ->find('p', 0); + $item['content'] .= $content; + } else { + $content = $article->find('section[class*=article__richtext]', 0) ->find('div', 0)->find('div', 0); - $item['content'] .= self::getUseFullContent($content); + $item['content'] .= self::getUseFullContent($content); + } for($i = 1; $i < count($pictures); $i++) { $imgUrl = $pictures[$i]->find('img', 0)->src;