Last active
May 26, 2019 11:06
-
-
Save arashmilani/ced2322b2b37ce679e59d9e10086feac to your computer and use it in GitHub Desktop.
Twitter "activity tweets" remover
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name twitter-activity-tweets-remover | |
// @namespace http://arashmilani.com/ | |
// @version 0.1 | |
// @description Twitter "activity tweets" remover | |
// @author Arash Milani | |
// @match https://*twitter.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
setInterval(() => { | |
let lis = document.querySelectorAll('.stream-item'); | |
for(let li of lis) { | |
if(li.tagName !== 'LI'){ | |
continue; | |
} | |
let dataSuggestioJson = li.getAttribute('data-suggestion-json'); | |
if(!dataSuggestioJson) { | |
continue; | |
} | |
let dataSuggestion = JSON.parse(dataSuggestioJson); | |
if(dataSuggestion.suggestion_details.suggestion_type === 'ActivityTweet') { | |
li.style.display = 'none'; | |
} | |
} | |
}, 3000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thumbs up for css solution