returnError('Could not request LeBonCoin.', 404); $list = $html->find('.list-lbc', 0); $tags = $list->find('a'); foreach($tags as $element) { $item = new \Item(); $item->uri = $element->href; $title = $element->getAttribute('title'); $content = 'thumbnail'; $date = $element->find('div.date', 0)->find('div', 0) . $element->find('div.date', 0)->find('div', 1) . '
'; $detailsList = $element->find('div.detail', 0); for ($i = 1; $i < 4; $i++) { $line = $detailsList->find('div', $i); $content .= $line; } $item->title = $title . ' - ' . $detailsList->find('div', 3); $item->content = $content . $date; $this->items[] = $item; } } public function getName(){ return 'LeBonCoin'; } public function getURI(){ return 'http://www.leboncoin.fr'; } public function getCacheDuration(){ return 3600; // 1 hour } }