From 963bbcc40239c772a404606b8bbc9c26e4800df5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Sun, 28 Aug 2016 13:14:56 +0200 Subject: [PATCH] [CourrierInternationalBridge] fix uri value and code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/CourrierInternationalBridge.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/bridges/CourrierInternationalBridge.php b/bridges/CourrierInternationalBridge.php index 634b88c..09d1aa6 100644 --- a/bridges/CourrierInternationalBridge.php +++ b/bridges/CourrierInternationalBridge.php @@ -3,16 +3,13 @@ class CourrierInternationalBridge extends BridgeAbstract{ public $maintainer = "teromene"; public $name = "Courrier International Bridge"; - public $uri = "http://CourrierInternational.fr/"; + public $uri = "http://CourrierInternational.com/"; public $description = "Courrier International bridge"; public function collectData(){ - $html = ''; - - $html = $this->getSimpleHTMLDOM('http://www.courrierinternational.com/') or $this->returnServerError('Error.'); - - + $html = $this->getSimpleHTMLDOM($this->uri) + or $this->returnServerError('Error.'); $element = $html->find("article"); @@ -25,7 +22,7 @@ class CourrierInternationalBridge extends BridgeAbstract{ $item['uri'] = $article->parent->getAttribute("href"); if(strpos($item['uri'], "http") === FALSE) { - $item['uri'] = "http://courrierinternational.fr/".$item['uri']; + $item['uri'] = $this->uri.$item['uri']; } $page = $this->getSimpleHTMLDOM($item['uri']);