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] [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');