You can read more about the backstory and code in my blog post.
This script removes all tweets from your timeline that are older than a certain number of days. It will delete up to 200 tweets per execution (as per Twitter‘s rate limits) and runs on any schedule.
You will need to head over to Twitter apps, create an app, and generate keys and access tokens. Then copy
.secrets.sample, rename it to
.secrets, and fill them in.
Then get an account with webtask, install the webtask CLI (
npm install -g wt-cli) and authenticate with
You are now all set to run
$ npm start
which installs all dependencies and exposes the script as a webtask URL that you can call. Do not forget to set the secret
MAX_TWEET_AGE inside the secrets file to your desired number of days.
Keybase.io Proof Tweet
If you are using keybase.io in combination with Twitter, you are asked to post a tweet as proof that you operate the account you claim to own. To prevent the tweet from being deleted (so that people can later verify it) just add its ID to the
$ npm test
If you want to deploy the webtask so it triggers automatically, run
$ npm run deploy
You can set the cron schedule inside
package.json. Per default it is set to
'0 3 * * *' in timezone Europe/Berlin (see other IANA timezone names on Wikipedia), so it would run every day, at 3:00 am CEST.