Created
October 24, 2023 01:46
-
-
Save Arturro43/6b8e81d77aef9a0f3945eb351bf571a2 to your computer and use it in GitHub Desktop.
X-twitterminate - remove all of your Twitter tweets (posts), retweets (reposts) and comments. Basically clean up your account.
This file contains hidden or 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
(function () { | |
var delTweets = function () { | |
var tweetsRemaining = document.querySelectorAll('[role="heading"]+div')[1].textContent; | |
console.log("Remaining: ", tweetsRemaining); | |
window.scrollBy(0, 10000); | |
var moreButtons = document.querySelectorAll('[aria-label="More"]'); | |
var deleteButtons = document.querySelectorAll('span:contains("Delete")'); | |
var confirmationButtons = document.querySelectorAll('[data-testid="confirmationSheetConfirm"]'); | |
var unretweetButtons = document.querySelectorAll('[data-testid="unretweet"]'); | |
var unretweetConfirmButtons = document.querySelectorAll('[data-testid="unretweetConfirm"]'); | |
moreButtons.forEach(function (button, index, array) { | |
button.click(); | |
deleteButtons[index].click(); | |
confirmationButtons[index].click(); | |
}); | |
unretweetButtons.forEach(function (button, index, array) { | |
button.click(); | |
unretweetConfirmButtons[index].click(); | |
}); | |
setTimeout(delTweets, 0); | |
}; | |
delTweets(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment