From 15e6d77569275da409ddf80871f322c513e7d9cc Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sat, 21 Jul 2018 18:06:59 +0200 Subject: [PATCH] [FierPandaBridge] Fix bridge This bridge now returns all articles from the front page, following layout changes in the past. References #679 --- bridges/FierPandaBridge.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/bridges/FierPandaBridge.php b/bridges/FierPandaBridge.php index cd9d11bd..15d1cd76 100644 --- a/bridges/FierPandaBridge.php +++ b/bridges/FierPandaBridge.php @@ -8,17 +8,22 @@ class FierPandaBridge extends BridgeAbstract { const DESCRIPTION = 'Returns latest articles from Fier Panda.'; public function collectData(){ + $html = getSimpleHTMLDOM(self::URI) or returnServerError('Could not request Fier Panda.'); - foreach($html->find('div.container-content article') as $element) { + defaultLinkTo($html, static::URI); + + foreach($html->find('article') as $article) { + $item = array(); - $item['uri'] = $this->getURI() . $element->find('a', 0)->href; - $item['title'] = trim($element->find('h1 a', 0)->innertext); - // Remove the link at the end of the article - $element->find('p a', 0)->outertext = ''; - $item['content'] = $element->find('p', 0)->innertext; + + $item['uri'] = $article->find('a', 0)->href; + $item['title'] = $article->find('a', 0)->title; + $this->items[] = $item; + } + } }