Rui Carmo is going through an interesting "de-socialising" process and it's mostly ended in this post, De-Tweeting, where he details how he's pruning his twitter account. Before Rui made is scripts public I'd done a similar thing with a PHP script, twitter_archive_zend.php I'd written. Fill in lines 12 and 13 with your Twitter username and password and set your maximum tweets on line 9. Then run and you'll get a JSON file that'll be appended to later on.
Be warned that this uses the Zend_Service_Twitter library and I'm fairly certain there are horrible caching issues going on. I've run it a few times with no username / password and it's brought back results - definitely not correct.