Delete All of Your Tweets & Retweets At Once
Delete All of Your Tweets
---------------
var delTweets = function () {
var tweetsRemaining =
document.querySelectorAll('[role="heading"]+div')[1].textContent;
console.log('Remaining: ', tweetsRemaining);
window.scrollBy(0, 10000);
document.querySelectorAll('[aria-label="More"]').forEach(function
(v, i, a) {
v.click();
document.querySelectorAll('span').forEach(function (v2, i2, a2) {
if (v2.textContent === 'Delete') {
v2.click();
document.querySelectorAll('[data-testid="confirmationSheetConfirm"]').forEach(function (v3, i3, a3) {
v3.click();
});
}
else {
document.body.click();
}
});
});
setTimeout(delTweets, 4000); //less than 4000 might be rate limited or account suspended. increase timeout if any suspend or rate limit happens
}
delTweets();
-------
Delete All of Your Re Tweets
--------------
var undoRetweets = function() {
var retweets = document.querySelectorAll('[data-testid="unretweet"]');
retweets.forEach(function(retweetButton) {
retweetButton.click(); // Click the unretweet button
// Handle the confirmation dialog
var confirmButton = document.querySelector('[data-testid="unretweetConfirm"]');
if (confirmButton) {
confirmButton.click();
}
});
console.log(retweets.length + ' retweets undone.');
window.scrollBy(0, 1000); // Scroll down to load more tweets
setTimeout(undoRetweets, 5000); // Wait for 5 seconds before repeating
};
undoRetweets();
Comments
Post a Comment