Skip to content

Instantly share code, notes, and snippets.

@tokozedg
Created September 17, 2023 17:46
Show Gist options
  • Save tokozedg/590f9f6fdd3e3c525944e6e1dc8aae7b to your computer and use it in GitHub Desktop.
Save tokozedg/590f9f6fdd3e3c525944e6e1dc8aae7b to your computer and use it in GitHub Desktop.
delete all tweets - 2023
(function () {
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, 0);
};
delTweets();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment