From e8232833c5c06099ba8b9213084721c51b006a08 Mon Sep 17 00:00:00 2001 From: Dejavu Moe Date: Fri, 12 May 2023 12:14:06 +0800 Subject: add twitter/deleteMyTweet.js --- twitter/deleteMyTweet.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 twitter/deleteMyTweet.js diff --git a/twitter/deleteMyTweet.js b/twitter/deleteMyTweet.js new file mode 100644 index 0000000..ae0ce3c --- /dev/null +++ b/twitter/deleteMyTweet.js @@ -0,0 +1,23 @@ +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(); -- cgit v1.2.3-54-g00ecf