From 3d76ac5d17965f559a4a2129ab5b38b2b091e1d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Sun, 28 Aug 2016 12:22:41 +0200 Subject: [PATCH] [CNETBridge] fix getName() 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/CNETBridge.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bridges/CNETBridge.php b/bridges/CNETBridge.php index b2963914..e9519766 100644 --- a/bridges/CNETBridge.php +++ b/bridges/CNETBridge.php @@ -37,7 +37,7 @@ class CNETBridge extends BridgeAbstract { return $article_html; } - $pageUrl = 'http://www.cnet.com/'.(empty($this->getInput('topic')) ? '' : 'topics/'.$this->getInput('topic').'/'); + $pageUrl = $this->uri.(empty($this->getInput('topic')) ? '' : 'topics/'.$this->getInput('topic').'/'); $html = $this->getSimpleHTMLDOM($pageUrl) or $this->returnServerError('Could not request CNET: '.$pageUrl); $limit = 0; @@ -45,7 +45,7 @@ class CNETBridge extends BridgeAbstract { if ($limit < 8) { $article_title = trim($element->find('h2', 0)->plaintext); - $article_uri = 'http://www.cnet.com'.($element->find('a', 0)->href); + $article_uri = $this->uri.($element->find('a', 0)->href); $article_timestamp = strtotime($element->find('time.assetTime', 0)->plaintext); $article_author = trim($element->find('a[rel=author]', 0)->plaintext); @@ -69,7 +69,7 @@ class CNETBridge extends BridgeAbstract { } public function getName() { - return 'CNET News Bridge'.(empty($this->getInput('topic')) ? '' : ' - '.$this->param['topic']['value']); + return 'CNET News Bridge'.(empty($this->getInput('topic')) ? '' : ' - '.$this->getInput('topic')); } public function getCacheDuration() {