From c34fdfa7fbbcf0089b54c462b788ad9d810b37b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Thu, 25 Aug 2016 01:49:30 +0200 Subject: [PATCH] [TwitterBridge] fix bridge name and bridge uri MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/TwitterBridge.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php index 2d5eb03..f3ad13b 100644 --- a/bridges/TwitterBridge.php +++ b/bridges/TwitterBridge.php @@ -40,6 +40,32 @@ class TwitterBridge extends BridgeAbstract{ ); } + public function getName(){ + switch($this->queriedContext){ + case 'By keyword or hashtag': + $specific='search '; + $param='q'; + break; + case 'By username': + $specific='@'; + $param='u'; + break; + } + return 'Twitter '.$specific + .$this->parameters[$this->queriedContext][$param]['value']; + } + + public function getURI(){ + $params=$this->parameters[$this->queriedContext]; + switch($this->queriedContext){ + case 'By keyword or hashtag': + return $this->uri.'search?q='.urlencode($params['q']['value']); + case 'By username': + return $this->uri.urlencode($params['u']['value']). + (isset($params['norep']['value'])?'':'/with_replies'); + } + } + public function collectData(){ $param=$this->parameters[$this->queriedContext]; $html = '';