[ScmBridge] code simplification

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière 2016-08-29 22:34:38 +02:00
parent 92e0bec925
commit b1d9d88772

View file

@ -8,11 +8,12 @@ class ScmbBridge extends BridgeAbstract{
public function collectData(){
$html = '';
$html = $this->getSimpleHTMLDOM('http://secouchermoinsbete.fr/') or $this->returnServerError('Could not request Se Coucher Moins Bete.');
$html = $this->getSimpleHTMLDOM($this->uri)
or $this->returnServerError('Could not request Se Coucher Moins Bete.');
foreach($html->find('article') as $article) {
$item = array();
$item['uri'] = 'http://secouchermoinsbete.fr'.$article->find('p.summary a',0)->href;
$item['uri'] = $this->uri.$article->find('p.summary a',0)->href;
$item['title'] = $article->find('header h1 a',0)->innertext;
$article->find('span.read-more',0)->outertext=''; // remove text "En savoir plus" from anecdote content