Automate deleting your tweets with a Raspberry Pi

I'm a tweet deleter. I do not think of Twitter as a great archive of knowledge but more a mere feed and notification system. It is basically an internet wide RSS feed, so no need to treat anything in it too preciously. Delete away everyone.

I've written a couple of one off scripts previously to mass delete and groom my feed, but I never really automated it, until now. I came across this post by Vicky Lai on how to automatically delete your Tweets using AWS Lambda, which she uses a Go program running on AWS to delete tweets.

I don't really want to bother with AWS, but I do have a Raspberry Pi that is running all the time as a PiHole network device. It wouldn't mind running a quick program every so often.; and Golang compiles to Pi, golden.


I modified Vicky's program ephemeral to run outside of Lambda and added one flag to allow keeping tweets older than a specific date around. I like keeping my first tweet around.

You can configure ephemeral to delete all tweets older than a certain number of hours and also after a specific date. Mine is configured for tweets older than 72 hours but newer than 2016.

Binary downloads and source available at:


You will need to create a new Twitter application and generate API keys.

The program assumes the following environment variables are set, see for an example:


MAX_TWEET_AGE expects a value of hours, such as: MAX_TWEET_AGE=72h

TWEPOCH expects a date value in YYYY-MM-DD format


  1. See releases in Github for binaries for Linux and Raspberry Pi.
  2. Source file to set environment variables
  3. Use --test flag to do a test run
$ source
$ ephemeral --test

Remove --test flag when you're ready to delete away.


I run this program using cron on a scheduled time off a Raspberry Pi. Here is the cron entry which shows sourcing prior to running at 8am everyday. See my Unix Crontab post for more info using cron.

0 8 * * * . path/to/dir/; path/to/dir/ephemeral


The program is a standard golang program, so the build process is quite straight-forward. The great thing about golang is its ability to target multiple architectures. You can do a cross-compile build for Raspberry Pi using:

env GOOS=linux GOARCH=arm GOARM=5 go build


Thanks to Vicky for publishing her program which was based off Adam Drake's Harold program. All of which use the Go client library for Twitter called Anaconda. So thanks all for the groundwork which makes this pretty easy.

To learn more about Golang, see my Working with Go tutorial.