From 485b465a2456bc5d10b7526cf94f9ae0439992ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=83=C2=A8re?= Date: Thu, 3 Aug 2017 00:26:32 +0200 Subject: [PATCH 1/2] [TwitterBridge] ignore promoted tweets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/TwitterBridge.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php index de2f00d..4c32bc7 100644 --- a/bridges/TwitterBridge.php +++ b/bridges/TwitterBridge.php @@ -106,6 +106,14 @@ class TwitterBridge extends BridgeAbstract { $invisible->outertext = ''; } + // Skip protmoted tweets + $heading=$tweet->previousSibling(); + if(!is_null($heading) && + $heading->getAttribute('class')==='promoted-tweet-heading' + ){ + continue; + } + $item = array(); // extract username and sanitize $item['username'] = $tweet->getAttribute('data-screen-name'); From c986ff91161f5793563dbc3baca6ff7181a78256 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Thu, 3 Aug 2017 17:56:39 +0200 Subject: [PATCH 2/2] [TwitterBridge] Fix coding style --- bridges/TwitterBridge.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php index 4c32bc7..d588f6b 100644 --- a/bridges/TwitterBridge.php +++ b/bridges/TwitterBridge.php @@ -107,10 +107,10 @@ class TwitterBridge extends BridgeAbstract { } // Skip protmoted tweets - $heading=$tweet->previousSibling(); + $heading = $tweet->previousSibling(); if(!is_null($heading) && - $heading->getAttribute('class')==='promoted-tweet-heading' - ){ + $heading->getAttribute('class') === 'promoted-tweet-heading' + ) { continue; }