Twitter Backup Rethreader


Download (Use "Save As")


rethreader.py was written for a friend who created a whole bunch of Twitter threads for fun, but could not recover them from the Twitter backup.

There were several issues: the formats for the individual tweets weren't isomorphic, the Twitter exporter inserted some extraneous newlines in front of \n literals, and the format of tweet data structure seemed to vary the further back you went.

rethreader.py was tested on my old main's backup, a 6 year old account with approximately 144k tweets. (That's about 65 tweets per day.) That's not a truly large size account but I hope I encounted most edge cases in that time. If you get any errors, please let me know and I'll try my hand at fixing them.


How to use

Download your Twitter export. The current instructions are here. For my account, it took roughtly 3 days before they were delivered.

Download Python - the most recent version for your OS will be selected above.

Download rethreader.py. The link is up above. Save it to a folder in your local machine. You may receive a notice that this is not a trusted download; that's because clock.horse is a very tiny website. It's just plain text, and you can view the code in Notepad before you run.

Copy tweets.js out of your Twitter export into the same directory as rethreader.py. tweets.js will be in the data directory of your backup. It's almost certainly going to be the largest file there.

Run IDLE. IDLE is the Integrated Development and Learning Enviroment for Python; it's installed automatically when you install Python. If you're unfamiliar with the command line, it's certainly the easiest way to just run one script as a one-off.

Open rethreader.py in IDLE (File > Open...) This will open a new window that holds the script.

Run rethreader.py in this new window. (Run > Run Module, or hit F5) Assuming all goes well, it will create tweets.json then threads.txt in the same directory. It will overwrite everything already existing in those files.

From there you can close IDLE's windows and browse your threads to your heart's content!