From d95fa6117aaab74d3eb6d0afb290993908575273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Sat, 27 Aug 2016 14:47:52 +0200 Subject: [PATCH] [IdenticaBridge] remove useless code and fix getURI() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/IdenticaBridge.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/bridges/IdenticaBridge.php b/bridges/IdenticaBridge.php index a9d3017..15ed759 100644 --- a/bridges/IdenticaBridge.php +++ b/bridges/IdenticaBridge.php @@ -1,8 +1,6 @@ maintainer = "mitsukarenai"; @@ -20,15 +18,9 @@ class IdenticaBridge 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('https://identi.ca/'.urlencode($this->request)) or $this->returnServerError('Requested username can\'t be found.'); - } - else { - $this->returnClientError('You must specify an Identica username (?u=...).'); - } + $html = $this->getSimpleHTMLDOM($this->getURI()) + or $this->returnServerError('Requested username can\'t be found.'); foreach($html->find('li.major') as $dent) { $item = array(); @@ -41,11 +33,13 @@ class IdenticaBridge extends BridgeAbstract{ } public function getName(){ - return (!empty($this->request) ? $this->request .' - ' : '') .'Identica Bridge'; + $param=$this->parameters[$this->queriedContext]; + return $param['u']['value'] .' - Identica Bridge'; } public function getURI(){ - return 'https://identica.com'; + $param=$this->parameters[$this->queriedContext]; + return $this->uri.urlencode($param['u']['value']); } public function getCacheDuration(){