From 596b9143a8b8c1e351bfccc648387845c9890b45 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Fri, 17 Mar 2017 18:41:35 +0100 Subject: [PATCH] [TwitterBridge] Add option to hide retweets Requested via #491 --- bridges/TwitterBridge.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php index ef34285..86dce7b 100644 --- a/bridges/TwitterBridge.php +++ b/bridges/TwitterBridge.php @@ -32,6 +32,12 @@ class TwitterBridge extends BridgeAbstract { 'name' => 'Without replies', 'type' => 'checkbox', 'title' => 'Only return initial tweets' + ), + 'noretweet' => array( + 'name' => 'Without retweets', + 'required' => false, + 'type' => 'checkbox', + 'title' => 'Hide retweets' ) ) ); @@ -82,6 +88,13 @@ class TwitterBridge extends BridgeAbstract { $hidePictures = $this->getInput('nopic'); foreach($html->find('div.js-stream-tweet') as $tweet){ + + // Skip retweets? + if($this->getInput('noretweet') + && $tweet->getAttribute('data-screen-name') !== $this->getInput('u')){ + continue; + } + $item = array(); // extract username and sanitize $item['username'] = $tweet->getAttribute('data-screen-name');