Last active
August 29, 2017 10:52
-
-
Save bulton-fr/19d76a754c5d67b1eec248a9d0519353 to your computer and use it in GitHub Desktop.
Twitter Clean Timeline
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
//Remove liked suggest tweet | |
const allTweetSuggest = document.querySelectorAll('div[data-component-context="suggest_activity_tweet"]'); | |
const nbSuggest = allTweetSuggest.length; | |
let suggestTweet; | |
for (let suggestLoopIndex = 0; suggestLoopIndex < nbSuggest; suggestLoopIndex++) { | |
suggestTweet = allTweetSuggest[suggestLoopIndex]; | |
suggestTweet.parentNode.remove(); | |
} | |
//Remove promoted suggest tweet | |
const allTweetPromoted = document.querySelectorAll('div[data-promoted="true"]'); | |
const nbPromoted = allTweetPromoted.length; | |
let promotedTweet; | |
for (let promotedLoopIndex = 0; promotedLoopIndex < nbPromoted; promotedLoopIndex++) { | |
promotedTweet = allTweetPromoted[promotedLoopIndex]; | |
promotedTweet.parentNode.remove(); | |
} | |
//Remove recap block | |
const allBlockRecap = document.querySelectorAll('li[data-component-context="suggest_recap"]'); | |
const nbRecap = allBlockRecap.length; | |
let recapBlock; | |
for (let recapLoopIndex = 0; recapLoopIndex < nbRecap; recapLoopIndex++) { | |
recapBlock = allBlockRecap[recapLoopIndex]; | |
recapBlock.remove(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment