Last active
August 18, 2024 00:02
-
-
Save vsubhash/8f200ac197a090a3661a to your computer and use it in GitHub Desktop.
Twitter Tweets Deleter (com.vsubhash.js.twitter_tweets_deleter) is a User Script that will automatically deletes tweets on a Twitter page, one after another. This script can be installed in Firfox browsers using the Greasemonkey add-on. WARNING: Remember to disabe this script after you have finished deleting your tweets. Otherwise, newer tweets …
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Twitter Tweets Deleter | |
// @namespace com.vsubhash.js.twitter_tweets_deleter | |
// @description Deletes all tweets one-by-one | |
// @version 2018 | |
// @grant none | |
// ==/UserScript== | |
document.addEventListener("DOMContentLoaded", startDeletingTweets, false); | |
var iVsJsTimeout1, iVsJsTimeout2, bFoundRetweet = false; | |
function startDeletingTweets() { | |
window.setTimeout(findDropDownMenu, 3*1000); | |
} | |
function findDropDownMenu() { | |
console.error("Searching for drop-down menus"); | |
var oButtons = document.getElementsByClassName("ProfileTweet-action"); | |
console.error("Found a drop-down menu"); | |
oButtons[0].className="dropdown open"; | |
window.setTimeout(clickOnDeleteOption, 3*1000); | |
} | |
function clickOnDeleteOption() { | |
try { | |
console.error("Finding the delete option"); | |
document.getElementsByClassName("js-actionDelete")[0].getElementsByTagName("button")[0].click(); | |
console.error("Clicked the delete option"); | |
window.setTimeout(clickOnDeleteConfirmButton, 3*1000); | |
} catch (e) { | |
console.error("TTD Error: " + e) | |
} | |
} | |
function clickOnDeleteConfirmButton() { | |
console.error("Finding the delete confirmation button"); | |
document.getElementsByClassName("delete-action")[0].click(); | |
console.error("Clicked the delete confirmation button"); | |
window.setTimeout(function() { location.reload(); }, 3*1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment