Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

python script to backup/delete old tweets from your timeline

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.mdown
Octocat-spinner-32 credentials.txt
Octocat-spinner-32 oldtweets.py
Octocat-spinner-32 requirements.txt
README.mdown

Oldtweets

OldTweets backs up (and deletes, if you so desire) all your tweets in separate files beyond the latest 50. Short URLs are expanded.

Requirements

This script will work if, and only if, you:

  1. Install required libs (via pip install -r requirements.txt)
  2. go to dev.twitter.com, sign up with your account and create a new app (the details can be bogus, your app will be private)
  3. copy the consumer key and secret from your app in a credentials file
  4. go to "my access token" in the (righthand) menu of your app and copy the token and key in a credentials file (a credentials file is distributed with this script, as a sample. This file doesn't work)

Manual

Run it to see the output (change the path to save your tweets txt files)

cat credentials.txt | ./oldtweets.py

Delete old tweets

cat credentials.txt | ./oldtweets.py --delete

Controlling how many tweets to ignore / keep in timeline

By default, the script will ignore the latests 50 tweets. If you want to choose another number (will be rounded down to the closest hundred):

cat credentials | ./oldtweets.py --keep=100

Credits

Based on a script by David Larlet (@davidbgk) Code, documentation and improvements contributed by Olivier Thereaux (@olivierthereaux), Karl Dubost (@karlpro), Florent Verschelde (@fvsch)

Something went wrong with that request. Please try again.