Python script which downloads your status updates and received direct messages from Twitter and stores them in a CSV file.
- simplejson. Download from http://pypi.python.org/pypi/simplejson/ or type ‘sudo easy_install simplejson’ into your terminal
- Rename
local_settings.py.template
tolocal_settings.py
. - Edit
local_settings.py
and fill in your Twitter Username and Password. - Save
local_settings.py
. - Run terminal (in Applications > Utilities) and type
python twitter_arc.py
- To update the backup run the command again. Only new status updates and direct messages since the last backup will be downloaded
- The first time the script runs it will download all Tweets and Direct Messages on your account which Twitter exposes. At the time of writing this was 3200 statuses. Direct messages vary but rarely go about 1000.
- The script requests 200 updates at a time, so be sensible about running it.
- The script uses the CSV file to know what the last tweet requested was. If you delete or move the file the script will assume a backup has never been made and download all of your exposed Tweets again.
- The script can only backup what Twitter exposes. If you have more than 3200 tweets this means a full backup of all your tweets is not possible.
- It is normal for the script to ask Twitter twice for the status updates if nothing has changed.
CSV was chosen as the output format as it requires no special databases to run and is legible on all computers. CSV can be opened by all popular spreadsheet packages and directly imported to databases if required.
Copyright © 2009 Matt Harris (http://themattharris.com)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
“Software”), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.