I built my own tweet scheduler that costs less than 1$ per month

I wanted a simple scheduler that would post tweets from my Notion database to Twitter.

I wanted an app without any bells and whistles, just a dumb scheduler. I didn’t want to pay 10$/month just for that. So as any developer would do, I decided to write my own scheduler.

Here’s how I did it.

i wrote a script tweeter.js which does the following

  • Get content from a Notion database.
  • create tweet
  • send it to twitter based on the scheduled time slot
  • Mark the tweet as posted in Notion.

I have hosted the scheduler in AWS and it runs as a container in ECS.

I use an Amazon EventBridge rule to create a new container every 30 minutes. This container is executed when started tweeter.js and ends. This way, I don’t have the server running all the time, which results in reduced costs.

It costs less than $1 a month and I can schedule as many tweets/threads as I want.

One caveat is that the Tweets schedule time is not accurate to a specific minute. It depends on the frequency at which a new container is created. I set it to 30 minutes, so if you schedule a tweet between 10:00 and 10:30 they will all be tweeted at the same time.

Reference

ECS Infrastructure Setup – https://github.com/vthub/scheduled-ecs-task

Leave a Comment