I love building things and recently placed as a runner up in the digitalocean hackathon and am pretty stoked to be getting moar hoodies! After my subtle brag about getting all the swag, a friend of mine then told me "why don't you make an app to automate getting more hoodies?".
What a fantastic idea.
I originally had a reddit bot written in node.js and thought "I have so many uses for bots, I don't want to deploy a new one for each idea. That would be a pain."
For my use case, I went against the whole microservices trend and kept all the scheduling and configuration for my three bots inside one long running process called
For the sake of staying on topic, you can browse the source here.
A bot that notifies you of potential opportunities for free dev shit also called "swag". Because we always need more laptop stickers, shirts, and hoodies!
After refactoring my app to support multiple bots, schedules, and configs. I implemented the "Free Dev Shit Bot". The bot is available on two platforms at the time of this writing.
Simply follow the bot for updates!
Create a channel called
swag in your discord server and add the bot to your server. The bot will check daily for free swag opportunities and notify you in the channel!
The bot will scan dev.to for the terms "free swag" and will tweet the article with a link and post to
swag channels on all subscribed discord servers.
At the start of the application, all bots are initialized and scheduled with node-schedule. The Free Dev Shit bot is scheduled to post to twitter and discord servers at 11:55 PM CST. The logic behind the scenes searches the dev.to
feed_content API by filtering the last 60 articles which is ordered newest. The bot then processes those 60 and finds any that are less than 24 hours old and has more than 1 public reaction(for credibility). If we have any results, simply post to all the things. The dev.to API is definitely the MVP here! 🥇