6

I built my own Tweet scheduler which costs less than 1$ per month

 1 year ago
source link: https://dev.to/dineshs91/i-built-my-own-tweet-scheduler-which-costs-less-than-1-per-month-5gbd
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Dinesh S

Posted on Oct 29

I built my own Tweet scheduler which costs less than 1$ per month

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

I wanted an app without any bells & whistles, just a dumb scheduler. I did not want to pay 10$/mo 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

  • Fetch content from a Notion database.
  • Prepare the 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 Amazon EventBridge rule to create a new container every 30 minutes. This container when started executes tweeter.js and terminates. This way, I don't have a server running all the time, which in turn results in reduced costs.

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

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

References

ECS infrastructure setup - https://github.com/vthub/scheduled-ecs-task


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK