diff --git a/bridges/TwitterBridgeExtended.php b/bridges/TwitterBridgeExtended.php index 0fdebb4e..8a6d0797 100644 --- a/bridges/TwitterBridgeExtended.php +++ b/bridges/TwitterBridgeExtended.php @@ -7,7 +7,19 @@ class TwitterBridgeExtended extends BridgeAbstract{ $this->name = "Twitter Bridge Extended"; $this->uri = "https://twitter.com/"; $this->description = "(same as Twitter Bridge, but with avatar, replies and RTs)"; - $this->update = "2016-08-09"; + $this->update = "2016-08-10"; + + $this->parameters["global"] = + '[ + { + "name" : "Hide profile pictures", + "identifier" : "pic", + "type" : "checkbox", + "required" : "false", + "exampleValue" : "checked", + "title" : "Activate to hide profile pictures in content" + } + ]'; $this->parameters["By keyword or hashtag"] = '[ @@ -39,6 +51,10 @@ class TwitterBridgeExtended extends BridgeAbstract{ $this->returnError('You must specify a keyword (?q=...) or a Twitter username (?u=...).', 400); } + $hidePictures = false; + if (isset($param['pic'])) + $hidePictures = $param['pic'] === 'on'; + foreach($html->find('div.js-stream-tweet') as $tweet) { $item = new \Item(); // extract username and sanitize @@ -79,9 +95,18 @@ class TwitterBridgeExtended extends BridgeAbstract{ // get tweet text $cleanedTweet = str_replace('href="/', 'href="https://twitter.com/', $tweet->find('p.js-tweet-text', 0)->innertext); + // Add picture to content + $picture_html = ''; + if(!$hidePictures){ + $picture_html = <<{$item->username} +EOD; + } + + // add content $item->content = << - {$item->username} + {$picture_html}
{$cleanedTweet}