An utility to parse Twitter's JSON archives and delete tweets, likes and direct messages.
Made because all alternatives appear to be online services and that looks like a very dumb idea to give access to some random website :-).
Have fun,
fG!
Just request your Twitter archive (Settings -> Your Account -> Download an archive of your data), and point the import command to the proper files included in the archive.
tweet.js
: contains all your tweets and retweetslike.js
: contains all your likesdirect-messages.js
: contains all your direct messags threads
You need a Twitter API key from Twitter developer. I had an old one, not sure if it's still easy to request or you need to justify and wait for authorization.
You will need to create a config.json
file with the API keys information. Hardcoded credentials is not a good idea :P.
{
"consumerkey": "INSERT CONSUMER KEY HERE",
"consumersecret": "INSERT CONSUMER SECRET HERE",
"accesstoken": "INSERT ACCESS TOKEN HERE",
"accesstokensecret": "INSERT ACCESS TOKEN SECRET HERE"
}
The config.json
should be on the same folder as the main binary.
I was afraid of API rate limitations as described in documentation but I was able to delete some 70k tweets without any problems. It took a while since this is single threaded and single request since otherwise I could hit some rate limitation on Twitter side.
The delete
command has a -l
flag to limit the number of items deleted if you manage to hit limits.
To build you can use the Makefile
make
Or
go build -o twitterwipe main.go
Tested only in macOS, should work in other OSes because Go promises that.
First step is to import the ids into the local database using the import
command.
twitterwipe import tweets tweet.js
Available commands to import
are tweets
, likes
, dms
.
The files in the archive are not straight JSON parseable by Go encoding/json
package but the code deals with it so you can use those files without a problem.
The next step is to remove the data from Twitter using the delete
command.
twitterwipe delete tweets
Available commands to delete
are tweets
, likes
, dms
.
The -l
or --limit
flag is available to limit the maximum number of items to delete (in case if you hit Twitter rate limitation, which I never did).
The status
command displays how many ids currently exist in the database.
twitterwipe status
Maybe...
- [] Delete by individual ID
- [] Import IDs via Twitter API (rate limited afaik!)