summaryrefslogtreecommitdiffstats
path: root/twitter/deleteMyTweet.js
diff options
context:
space:
mode:
authorDejavu Moe <[email protected]>2023-05-12 12:14:06 +0800
committerDejavu Moe <[email protected]>2023-05-12 12:14:06 +0800
commite8232833c5c06099ba8b9213084721c51b006a08 (patch)
treef282897786d0d483c8818f1f7f4ef4f095ef35b6 /twitter/deleteMyTweet.js
parent6cef0f58927a8532767f2a8e853751cae2181e22 (diff)
downloadgist-e8232833c5c06099ba8b9213084721c51b006a08.tar.gz
gist-e8232833c5c06099ba8b9213084721c51b006a08.zip
add twitter/deleteMyTweet.js
Diffstat (limited to 'twitter/deleteMyTweet.js')
-rw-r--r--twitter/deleteMyTweet.js23
1 files changed, 23 insertions, 0 deletions
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();