From 614d425da4e3d37abbdc34444ba8de3304979eb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Sat, 27 Aug 2016 14:57:43 +0200 Subject: [PATCH] [InstagramBridge] fix uri, remove useless code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/InstagramBridge.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/bridges/InstagramBridge.php b/bridges/InstagramBridge.php index 2c2a7e0c..9b48890d 100644 --- a/bridges/InstagramBridge.php +++ b/bridges/InstagramBridge.php @@ -1,8 +1,6 @@ maintainer = "pauder"; @@ -20,15 +18,8 @@ class InstagramBridge extends BridgeAbstract{ } public function collectData(){ - $param=$this->parameters[$this->queriedContext]; - $html = ''; - if (isset($param['u']['value'])) { /* user timeline mode */ - $this->request = $param['u']['value']; - $html = $this->getSimpleHTMLDOM('http://instagram.com/'.urlencode($this->request)) or $this->returnServerError('Could not request Instagram.'); - } - else { - $this->returnClientError('You must specify a Instagram username (?u=...).'); - } + $html = $this->getSimpleHTMLDOM($this->getURI()) + or $this->returnServerError('Could not request Instagram.'); $innertext = null; @@ -74,6 +65,13 @@ class InstagramBridge extends BridgeAbstract{ } public function getName(){ - return (!empty($this->request) ? $this->request .' - ' : '') .'Instagram Bridge'; + $param=$this->parameters[$this->queriedContext]; + return $this->param['u']['value'] .' - Instagram Bridge'; + } + + public function getURI(){ + $param=$this->parameters[$this->queriedContext]; + return $this->uri.urlencode($param['u']['value']); } } +