GithubHelp home page GithubHelp logo

deltweet's Introduction

A tool to mass-delete tweets

This tool uses a (as of now) not ratelimited API on Twitter/X to delete all you tweets before you say goodbye to this hellhole.

To use this tool you need two things:

Archive of your tweets

You can request this archive by going to Settings -> Your Account -> Download an archive of your data. When you receive this archive it will contain a file data/tweets.js that you need for this tool.

Authdata from Twitter/X

You need authentication data for this tool to work. To get this you will need to use the Inspect Tool of your browser (For Firefox it is under Tools -> Browser Tools -> Web Developer Tools). Go to the Twitter homepage and open the tool on the Network Page. Then reload the Twitter homepage. You should see a lot of requests. Look for requests of the type xhr. When you find one click on it and on the right side you should see a tab with the headers of the request. The authentication data is under Response Headers. You need three header lines to make this tool work, x-csrf-token, authorization and cookie. Please copy the entire value of these three headers, otherwise authentication will fail.

Copy all three of these into a textfile. It should look something like this:

x-csrf-token: 8a1999b9ba[...]
authorization: Bearer AAAAAAAAAAAAAAAAAAAAANRI[...]
Cookie: guest_id=v1%[...]

Now you can run the tool and it will start deleting your tweets. It will save its current state to an cache.json file in the same directory as the tool.

To set it up in a python virtual environment and run it, just do this:

$ python3 -m venv venv
$ source venv/bin/activate
(venv) $ pip install -U pip wheel
(venv) $ pip install -r requirements.txt
(venv) $ python3 ./deltweet.py -t twitter-archive/data/tweets.js -a twitter-auth.txt
2023-10-18 17:54:49,570 - DelTweet._setup_tweets - INFO - Loaded 31209 tweets
2023-10-18 17:54:49,595 - DelTweet._setup_tweets - INFO - Setup 31209 tweets with 15702 already deleted
2023-10-18 17:54:49,638 - DelTweet.delete_tweet - INFO - Deleting tweet 7748268540821504
2023-10-18 17:54:49,943 - DelTweet.delete_tweet - INFO - Deleting tweet 1456910654066118658
2023-10-18 17:54:50,118 - DelTweet.delete_tweet - INFO - Deleting tweet 1598813283816980482

Just let it run, it can take a few hours depending on the amount of tweets. You can stop it by pressing CTRL-C and it will resume where it was when you start it the next time.

deltweet's People

Contributors

sebastianw avatar adorakalb avatar

Stargazers

Mohsen Aghandideh avatar Nacho Morató avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.