From 71d8f4c46570dce44dd363a776443b0341aca6af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Sat, 20 Aug 2016 11:18:06 +0200 Subject: [PATCH 1/2] [TwitterBridge] add 'Without replies' parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/TwitterBridge.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php index da6b4cd..fa70b09 100644 --- a/bridges/TwitterBridge.php +++ b/bridges/TwitterBridge.php @@ -42,6 +42,14 @@ class TwitterBridge extends BridgeAbstract{ "required" : true, "exampleValue" : "sebsauvage", "title" : "Insert a user name" + }, + { + "name" : "Without replies", + "identifier" : "norep", + "type" : "checkbox", + "required" : false, + "exampleValue" : "checked", + "title" : "Only return initial tweets" } ]'; @@ -53,7 +61,7 @@ class TwitterBridge extends BridgeAbstract{ $html = $this->getSimpleHTMLDOM('https://twitter.com/search?q='.urlencode($param['q']).'&f=tweets') or $this->returnServerError('No results for this query.'); } elseif (isset($param['u'])) { /* user timeline mode */ - $html = $this->getSimpleHTMLDOM('https://twitter.com/'.urlencode($param['u']).'/with_replies') or $this->returnServerError('Requested username can\'t be found.'); + $html = $this->getSimpleHTMLDOM('https://twitter.com/'.urlencode($param['u']).(isset($param['norep'])?'':'/with_replies')) or $this->returnServerError('Requested username can\'t be found.'); } else { $this->returnClientError('You must specify a keyword (?q=...) or a Twitter username (?u=...).'); From 6e66c228f87f7ff520a9a77f61d79297fcc8e82e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Sat, 20 Aug 2016 12:32:05 +0200 Subject: [PATCH 2/2] [TwitterBridge] rename 'pic' parameter to more consistent 'nopic' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/TwitterBridge.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php index fa70b09..ca4d306 100644 --- a/bridges/TwitterBridge.php +++ b/bridges/TwitterBridge.php @@ -13,7 +13,7 @@ class TwitterBridge extends BridgeAbstract{ '[ { "name" : "Hide profile pictures", - "identifier" : "pic", + "identifier" : "nopic", "type" : "checkbox", "required" : false, "exampleValue" : "checked", @@ -68,8 +68,8 @@ class TwitterBridge extends BridgeAbstract{ } $hidePictures = false; - if (isset($param['pic'])) - $hidePictures = $param['pic'] === 'on'; + if (isset($param['nopic'])) + $hidePictures = $param['nopic'] === 'on'; foreach($html->find('div.js-stream-tweet') as $tweet) { $item = new \Item();