I gave in to my paranoid tendencies today and wrote a little backup script for Twitter, which I figured I'd share here.

Two requirements:

To install these from the terminal:

Here's the script to do the backup itself (which I plan to run ~1/mo):

For some reason it's only retrieving ~3,000 of my tweets (when I have 5,000+). From a quick perusal of the web, several people mentioned that Twitter has limited this API to just 3,200 results. Bummer! Should still work for most folks, plus I like the CSV format.

You can also retrieve a full backup by going to your Account Settings and requesting "Your Tweet Archive" at the bottom. It gives you a nice little viewer too! And this one gives you all of your tweets, not just the last 3,000. 🙂 I like having both formats.