From 0f2cfe06d3c3c32c23725314f4449ea0edbe591b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 23:21:59 +0200 Subject: [PATCH] [TagBoardBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/TagBoardBridge.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bridges/TagBoardBridge.php b/bridges/TagBoardBridge.php index 444eb62..53b6b41 100644 --- a/bridges/TagBoardBridge.php +++ b/bridges/TagBoardBridge.php @@ -3,7 +3,7 @@ class TagBoardBridge extends BridgeAbstract{ public $maintainer = "Pitchoule"; public $name = "TagBoard"; - public $uri = "http://www.TagBoard.com"; + public $uri = "http://www.TagBoard.com/"; public $description = "Returns most recent results from TagBoard."; public $parameters = array( array( @@ -14,11 +14,10 @@ class TagBoardBridge extends BridgeAbstract{ )); public function collectData(){ - $html = ''; - $this->request = $this->getInput('u'); - $link = 'https://post-cache.tagboard.com/search/' .$this->request; + $link = 'https://post-cache.tagboard.com/search/' .$this->getInput('u'); - $html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request TagBoard for : ' . $link); + $html = $this->getSimpleHTMLDOM($link) + or $this->returnServerError('Could not request TagBoard for : ' . $link); $parsed_json = json_decode($html); foreach($parsed_json->{'posts'} as $element) { @@ -36,7 +35,7 @@ class TagBoardBridge extends BridgeAbstract{ } public function getName(){ - return 'tagboard - ' .$this->request; + return 'tagboard - ' .$this->getInput('u'); } public function getCacheDuration(){