ephemeral: delete tweets
You can use ephemeral to automatically delete all tweets from your timeline that are older than a certain number of hours that you can choose. For instance, you can ensure that your tweets are deleted after one week (168h), or one day (24h).
You can also set a date to not delete prior to, which I named the twepoch. This is used in case you want to keep early tweets around.
This program uses the Go client library Anaconda to access the Twitter API. You will need to create a new Twitter application and generate API keys.
The program assumes the following environment variables are set:
TWITTER_CONSUMER_KEY TWITTER_CONSUMER_SECRET TWITTER_ACCESS_TOKEN TWITTER_ACCESS_TOKEN_SECRET MAX_TWEET_AGE TWEPOCH
MAX_TWEET_AGE expects a value of hours, such as:
TWEPOCH expects a date value in
See releases for binary downloads for Linux and Raspberry Pi.
$ source env.sh $ ephemeral --test
--testflag when you're ready to delete away
I run this program using cron on a schedule time running on a Raspberry Pi. Here is the cron entry which shows soucing env.sh prior to running.
0 8 * * * . path/to/dir/env.sh; path/to/dir/ephemeral
The program is a standard golang program, so the build process is quite straight-forward.
$ git clone https://github.com/mkaz/ephemeral $ cd ephemeral $ go get $ go build
Run on a Raspberry Pi
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
This code is modified from Vicky Lai, who modified her code from Adam Drake, both of which released under the MIT license, so let's keep that license train going.