소스 검색

Merge branch 'TwitterWithoutPromotedTweets'

Closes #556
logmanoriginal 6 년 전
부모
커밋
c7ec50373a
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      bridges/TwitterBridge.php

+ 8 - 0
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');