This content originally appeared on DEV Community 👩💻👨💻 and was authored by Dinesh S
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
This content originally appeared on DEV Community 👩💻👨💻 and was authored by Dinesh S
Dinesh S | Sciencx (2022-10-29T06:20:11+00:00) I built my own Tweet scheduler which costs less than 1$ per month. Retrieved from https://www.scien.cx/2022/10/29/i-built-my-own-tweet-scheduler-which-costs-less-than-1-per-month/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.