From f64664a83ce8f9c7d233bb3afcdd91d90347357b Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Sat, 4 Jun 2016 09:05:13 +0200 Subject: [PATCH] Use "Lire la suite" link for extracting link and title This makes detection more dependable, because if there's no illustrating image there may not be a first paragraph. --- bridges/WikipediaFRBridge.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bridges/WikipediaFRBridge.php b/bridges/WikipediaFRBridge.php index 741452a7..0e96932e 100644 --- a/bridges/WikipediaFRBridge.php +++ b/bridges/WikipediaFRBridge.php @@ -7,7 +7,7 @@ class WikipediaFRBridge extends BridgeAbstract{ $this->name = "Wikipedia FR 'Lumière sur...'"; $this->uri = "https://fr.wikipedia.org/"; $this->description = "Returns the highlighted fr.wikipedia.org article."; - $this->update = "2014-05-25"; + $this->update = "2016-06-04"; } @@ -20,11 +20,11 @@ class WikipediaFRBridge extends BridgeAbstract{ $html = file_get_html($host.$link) or $this->returnError('Could not request Wikipedia FR.', 404); - $element = $html->find('div[id=accueil-lumieresur]', 0); + $element = $html->find('div[id=mf-lumieresur]', 0); $item = new \Item(); - $item->uri = $host.$element->find('p', 0)->find('a', 0)->href; - $item->title = $element->find('p',0)->find('a',0)->title; - $item->content = str_replace('href="/', 'href="'.$host.'/', $element->find('div[id=mf-lumieresur]', 0)->innertext); + $item->uri = $host.$element->find('.BA > i > a', 0)->href; + $item->title = $element->find('.BA > i > a',0)->title; + $item->content = str_replace('href="/', 'href="'.$host.'/', $element->innertext); $this->items[] = $item; }