From 753735b3e3ca127ae55d007c94b771e8d0408c85 Mon Sep 17 00:00:00 2001 From: Nicolas Delsaux Date: Fri, 6 Sep 2019 10:51:13 +0200 Subject: [PATCH] [GQMagazineBridge] Adapt to changes, fixes #1280 --- bridges/GQMagazineBridge.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bridges/GQMagazineBridge.php b/bridges/GQMagazineBridge.php index 9daa90231db..2884ab6b197 100644 --- a/bridges/GQMagazineBridge.php +++ b/bridges/GQMagazineBridge.php @@ -61,7 +61,7 @@ public function getURI() private function findTitleOf($link) { foreach (self::POSSIBLE_TITLES as $tag) { - $title = $link->find($tag, 0); + $title = $link->parent()->find($tag, 0); if($title !== null) { if($title->plaintext !== null) { return $title->plaintext; @@ -77,11 +77,13 @@ public function collectData() // Since GQ don't want simple class scrapping, let's do it the hard way and ... discover content ! $main = $html->find('main', 0); foreach ($main->find('a') as $link) { + if(strpos($link, $this->getInput('page'))) + continue; $uri = $link->href; - $date = $link->find('time', 0); + $date = $link->parent()->find('time', 0); $item = array(); - $author = $link->find('span[itemprop=name]', 0); + $author = $link->parent()->find('span[itemprop=name]', 0); if($author !== null) { $item['author'] = $author->plaintext; $item['title'] = $this->findTitleOf($link);