Skip to content

Instantly share code, notes, and snippets.

@BitWizCoder-ol
Forked from obedparla/delete_all_tweets.js
Created December 22, 2024 14:59
Show Gist options
  • Select an option

  • Save BitWizCoder-ol/93e04acb79810e95a5f127f846834d6f to your computer and use it in GitHub Desktop.

Select an option

Save BitWizCoder-ol/93e04acb79810e95a5f127f846834d6f to your computer and use it in GitHub Desktop.

Revisions

  1. @obedparla obedparla created this gist Jun 20, 2023.
    30 changes: 30 additions & 0 deletions delete_all_tweets.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    // Delete ALL your tweets and un-retweet everything
    // Just paste this code on the dev tools and leave the tab open. It deletes at [speed]. Make it faster or slower
    // I don't know if Twitter has some internal safety to prevent a bunch of deletions from happening to fast, but at 100 it deletes 1000 tweets in under two minutes

    // BEWARE you can't undo this action, and it will delete EVERYTHING

    const speed = 100;

    // do it on repeat. Timeouts are ugly but whatever, it works
    setInterval(function (){
    const retweets = document.querySelectorAll("[data-testid='unretweet']");

    retweets.forEach((item, index) => {
    setTimeout(() => {
    item.click()
    document.querySelector("[data-testid='unretweetConfirm']").click();
    }, index * speed);
    })

    setTimeout(() => {
    document.querySelectorAll("[data-testid='caret']").forEach((menu, index) => {
    setTimeout(() => {
    menu.click()
    document.querySelector('[role="menuitem"]').click();
    document.querySelector("[data-testid='confirmationSheetConfirm']").click()
    }, index * speed)

    })
    }, retweets.length * (speed + 5));
    }, 1000)