-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNukeTweets.js
27 lines (25 loc) · 933 Bytes
/
NukeTweets.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Credits: Uzay https://stackoverflow.com/a/72515907
// Paste into Console on https://twitter.com/<username>
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();