WikipediaFRBridge: also support .AdQ lire la suite link
This commit is contained in:
parent
feb34c9eb1
commit
83adf25c56
1 changed files with 6 additions and 2 deletions
|
@ -21,9 +21,13 @@ class WikipediaFRBridge extends BridgeAbstract{
|
||||||
$html = file_get_html($host.$link) or $this->returnError('Could not request Wikipedia FR.', 404);
|
$html = file_get_html($host.$link) or $this->returnError('Could not request Wikipedia FR.', 404);
|
||||||
|
|
||||||
$element = $html->find('div[id=mf-lumieresur]', 0);
|
$element = $html->find('div[id=mf-lumieresur]', 0);
|
||||||
|
# Use the "Lire la suite" link to dependably get the title of the article
|
||||||
|
# usually it's a child of a li.BA element (Bon article)
|
||||||
|
# occasionally it's a li.AdQ (Article de qualité)
|
||||||
|
$lirelasuite_link = $element->find('.BA > i > a, .AdQ > i > a', 0);
|
||||||
$item = new \Item();
|
$item = new \Item();
|
||||||
$item->uri = $host.$element->find('.BA > i > a', 0)->href;
|
$item->uri = $host.$lirelasuite_link->href;
|
||||||
$item->title = $element->find('.BA > i > a',0)->title;
|
$item->title = $lirelasuite_link->title;
|
||||||
$item->content = str_replace('href="/', 'href="'.$host.'/', $element->innertext);
|
$item->content = str_replace('href="/', 'href="'.$host.'/', $element->innertext);
|
||||||
$this->items[] = $item;
|
$this->items[] = $item;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue