Prerequisites: a Twitter account, moderate command line and Google Cloud experience.

Time to complete: a couple of hours.

Alternatively you might consider GitLab hosting.

Developer account

Apply for a Twitter dev account, create an app and make a note of the two API keys. Keep them to yourself.

Google Cloud hosting

Create the smallest (and cheapest) Linux instance on Google Cloud.

Installation

Connect to your instance and install the essentials.

sudo apt update && \
sudo apt install rubygems --yes && \
sudo gem install twurl

Authentication

Authenticate your instance with the two keys you saved earlier. There’s quite a cool PIN exchange with Twitter too.

twurl authorize --consumer-key xxxxxxxx --consumer-secret xxxxxxxx

This will write your authentication details into ~/.twurl which you can copy to another machine and use without reauthenticating.

Schedule

Connect to your instance and edit your cron tab to make your job run every minute (note the explicit path to twurl).

crontab -e

See cron tab guru for the syntax.

* * * * * /usr/local/bin/twurl -X POST -H api.twitter.com "/1.1/statuses/update.json?status=$(date)"

See what cron is up to.

tail -f /var/log/syslog

References