Announcing Twitter Nuke
A tool to efficiently delete tweet history without rate limits
Hello! I recently decided to ditch the Twitter platform but wanted to do so without deleting my account. Therefore, I deleted all my past tweets and thus spent a couple of minutes writing a script using the Twitter API that did precisely that.
However, I needed to remember the 3200 tweet limit imposed by the API. I had about 11.4k tweets which was a number way past the limit. Thus, my script brought the numbers down from 11.4k to about 8.5k. My next challenge was to figure out how to delete the remaining tweets.
I learned about sites and online tools that could delete past tweets regardless of if it was in the 3200 most recent tweets. They were either paid or unreliable, and I wanted to save money. The websites and tools used the Twitter Archive to grab and delete tweets. The very next thing I did was request an archived snapshot and started exploring it.
Upon investigating the archive (it arrived in 3 days), I discovered the tweets.js file; a JSON object was assigned to a variable for feeding data to the web page. This made parsing data much easier as it was just as easy as reading a JSON file. I finally wrote a script that grabbed the ID of all tweets and deleted them using "destroy_status()" method of the Twitter API.
The script uses multithreading to speed up the deletion process by running multiple instances of the Twitter API. We can improve the speed up to ~50-60 times the single-threaded performance, which is ~1 tweet per sec)
I realized sharing my process here would help others wanting to write scripts for menial tasks. Also, I would love to get feedback, suggestions, and contributions! Here's the link to my repository.