[FindACrew] Improve bridge results (#1120)

This commit is contained in:
Thibault Couraud 2019-06-16 17:35:43 +00:00 committed by LogMANOriginal
parent 8dd8be9694
commit 686f21bc50

View file

@ -62,11 +62,16 @@ class FindACrewBridge extends BridgeAbstract {
foreach ($annonces as $annonce) {
$item = array();
$img = parent::getURI() . $annonce->find('.lst-pic img', 0)->getAttribute('src');
$link = parent::getURI() . $annonce->find('.lst-ctrls a', 0)->href;
$htmlDetail = getSimpleHTMLDOMCached($link . '?mdl=2'); // add ?mdl=2 for xhr content not full html page
$img = parent::getURI() . $htmlDetail->find('img.img-responsive', 0)->getAttribute('src');
$item['title'] = $annonce->find('.lst-tags span', 0)->plaintext;
$item['uri'] = parent::getURI() . $annonce->find('.lst-ctrls a', 0)->href;
$content = $annonce->find('.lst-dtl', 0)->innertext;
$item['content'] = "<img src='$img' /><br>$content";
$item['uri'] = $link;
$content = $htmlDetail->find('.panel-body div.clearfix.row > div', 1)->innertext;
$content .= $htmlDetail->find('.panel-body > div', 1)->innertext;
$content = defaultLinkTo($content, parent::getURI());
$item['content'] = $content;
$item['enclosures'] = array($img);
$item['categories'] = array($annonce->find('.css_AccLocCur', 0)->plaintext);
$this->items[] = $item;