From d4d635a7d2ea78d5b6f922662281458b3332840a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Sun, 28 Aug 2016 14:13:45 +0200 Subject: [PATCH] [EliteDangerousGalnetBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/EliteDangerousGalnetBridge.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bridges/EliteDangerousGalnetBridge.php b/bridges/EliteDangerousGalnetBridge.php index 26f091f..a15718a 100644 --- a/bridges/EliteDangerousGalnetBridge.php +++ b/bridges/EliteDangerousGalnetBridge.php @@ -3,17 +3,18 @@ class EliteDangerousGalnetBridge extends BridgeAbstract { public $maintainer = "corenting"; public $name = "Elite: Dangerous Galnet"; - public $uri = "https://community.elitedangerous.com/galnet"; + public $uri = "https://community.elitedangerous.com/galnet/"; public $description = "Returns the latest page of news from Galnet"; public function collectData() { - $html = $this->getSimpleHTMLDOM('https://community.elitedangerous.com/galnet') or $this->returnServerError('Error while downloading the website content'); + $html = $this->getSimpleHTMLDOM($this->uri) + or $this->returnServerError('Error while downloading the website content'); foreach($html->find('div.article') as $element) { $item = array(); $uri = $element->find('h3 a', 0)->href; - $uri = 'https://community.elitedangerous.com' . $uri; + $uri = $this->uri . substr($uri,strlen('/galnet/')); $item['uri'] = $uri; $title = $element->find('h3 a', 0)->plaintext;