From b1d9d887727f2dcbff1596175388bddf098a4259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 22:34:38 +0200 Subject: [PATCH] [ScmBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/ScmbBridge.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bridges/ScmbBridge.php b/bridges/ScmbBridge.php index 9e5997e..0e0974b 100644 --- a/bridges/ScmbBridge.php +++ b/bridges/ScmbBridge.php @@ -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