A simple script to delete tweets.
Make sure to have ruby installed (you can use rvm), and then install dependencies with bundler:
rvm install 2.4.0
rvm use 2.4.0
gem install bundler:2.0.1
bundle install
Set the required environment variables in .env
containing your twitter API credentials:
-
TWITTER_CONSUMER_KEY=
-
TWITTER_CONSUMER_SECRET=
-
TWITTER_ACCESS_TOKEN_KEY=
-
TWITTER_ACCESS_TOKEN_SECRET=
-
USERNAME=
-
DELETE_RETWEETS=
-
RELATIVE_DAYS=
-
DRY_RUN=
You can use the sample env file for reference:
cp .env.sample .env
You can get Twitter API credentials from the Twitter apps page.
Additional info on generating acess tokens in this gist.
Run the script:
$ ruby deleter.rb
docker build -f Dockerfile -t twitter-deleter .
docker run --env-file=.env twitter-deleter