Twitter Backup Utility
June 10, 2009
The following is a simple tool I hacked together in Java that downloads your twitter statuses to a directory, to test out the new WinRun4J Plugin for Eclipse. I wrote a simple Java class and then exported it to a single fat executable (console version): TwitterBackup.exe.
Note that you need Java to run this application: You can download it from here.
If you run it without command line arguments you get:
Twitter Backup v0.1.0 @winrun4j A backup utility for Twitter statuses. TwitterBackup [-user <user>|-search <search>] -outdir <backup_dir> [-limit #hours|day|week|month|year]
-user option is simply your twitter user id.
-search option is a search query (you probably want to put “quotes” around it).
-outdir option is the directory you want the statuses saved into.
-limit option sets a time/date limit on the history, so “day” only loads statuses for the last 24 hours. The #hours is a number of hours (e.g.
-limit 4 only saves statuses from the last 4 hours).
TwitterBackup -user twitter -outdir C:/TEMP -limit 12
This will save the “twitter” user’s statuses from the last 12 hours to the directory
TwitterBackup -search "cool filter:links" -outdir C:/TEMP -limit day
This will save all search results for “cool filter:links” for the last 24 hours to the directory
The utility is also incremental so you can run it over and over again and it will only grab new statuses.
It is designed to be run as a scheduled task (e.g. setup a schedule task to run every week and use the -limit week option).
Each twitter status is saved into a separate file using the unique status id provided by twitter. It simply contains the RSS item XML.
You can download TwitterBackup here
Note that Twitter has limits on how much you can download at one time and how far back in time you can go.
BTW The utility should work as specified but the author accepts no responsibilities is something screws up. Use at your own risk.