Skip to content

Instantly share code, notes, and snippets.

@Nikaoto
Last active July 27, 2020 09:28
Show Gist options
  • Save Nikaoto/cd31f9cf287c1145e9b676866b397e81 to your computer and use it in GitHub Desktop.
Save Nikaoto/cd31f9cf287c1145e9b676866b397e81 to your computer and use it in GitHub Desktop.
Remove every tweet, retweet & like
setInterval(function() {
// Remove retweets
for (let e of document.querySelectorAll('[data-testid="unretweet"')) {
e.click();
// Click undo retweet popup
for (let u of document.querySelectorAll('div[data-testid="unretweetConfirm"')) {
u.click();
}
// Remove tweet div
e.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.removeChild(e);
}
// Remove likes
for (let e of document.querySelectorAll('[data-testid="unlike"]')) {
e.click();
e.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.removeChild(e);
}
// Remove tweets
for (let e of document.querySelectorAll('div[aria-label="More"]')) {
// Drop down the menu
e.click();
// Click delete button
for (let m of document.querySelectorAll('div[role="menu"]')) {
let delbutton = m.firstChild.firstChild.firstChild.firstChild.childNodes[1].firstChild.firstChild;
delbutton.click();
// Accept delete tweet popup
for (let e2 of document.querySelectorAll('div[data-testid="confirmationSheetConfirm"]')) {
e2.click();
}
}
e.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.removeChild(e);
}
// Scroll to bottom
window.scrollTo(0, document.body.scrollHeight);
}, 100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment