Created
December 2, 2025 18:05
-
-
Save mattkenefick/ab108824a5da9c050875fbf64c40d457 to your computer and use it in GitHub Desktop.
Delete your 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
| /** | |
| * Not the most efficient way of doing it, but better than paying for a service. | |
| * This will hit rate limits, so you'll have to do it more than once. | |
| * | |
| * Username would be your name as seen in an individual tweet. | |
| */ | |
| async function deleteTweet() { | |
| const username = 'abc efg'; | |
| let tweets = [...document.querySelectorAll('article')].filter((tweet) => tweet.innerText.includes(username)); | |
| if (!tweets || tweets.length === 0) { | |
| window.scrollTo({ | |
| top: document.documentElement.scrollHeight, | |
| behavior: 'auto', | |
| }); | |
| } | |
| // Open menu | |
| tweets[0].querySelector('button[aria-haspopup="menu"]').click(); | |
| // Start delete | |
| setTimeout(() => document.querySelector('div[role=menuitem]').click(), 100); | |
| // Delete | |
| setTimeout(() => document.querySelector('button[data-testid="confirmationSheetConfirm"]').click(), 200); | |
| } | |
| setInterval(() => deleteTweet(), 500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment