Skip to content

Instantly share code, notes, and snippets.

@Treeki
Last active August 29, 2015 14:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Treeki/d082f7190d61007bde7d to your computer and use it in GitHub Desktop.
Save Treeki/d082f7190d61007bde7d to your computer and use it in GitHub Desktop.
# Usage:
# 1. Install twurl from RubyGems
# 2. Create a Twitter app at https://apps.twitter.com/ (if you don't have one)
# 3. twurl authorize --consumer-key ldny[...]ulfQ --consumer-secret MTXY[...]TRsI
# 4. bash tweet_deleter.sh 2010-05 tweets.csv
# Use at your own risk ;)
# Notes for using multiple accounts with twurl:
# To list active accounts + tokens (and see the current default):
# $ twurl accounts
# To set the default/active account for all future requests:
# $ twurl set default [username]
# $ twurl set default [username] [consumer-key]
# i.e.:
# $ twurl set default _Ninji
# $ twurl set default _Ninji ldny[...]ulfQ
# (The latter variant is only necessary if your twurl config has
# multiple consumer keys authorised with the same account.)
# You can view/edit/remove the twurl tokens by accessing ~/.twurlrc
tweet_date=$1
tweet_file=$2
for tweet_id in $(grep -E "^\"[0-9]+\",\"[0-9]*\",\"[0-9]*\",\"$tweet_date" $tweet_file | cut -d"\"" -f2); do
twurl -X POST /1.1/statuses/destroy/$tweet_id.json
sleep 15
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment