Step 2: Set up a Twitter bot

Building a Twitter bot is super easy because there's a lot of existing code you can use. My strategy for getting started was to a) use the Twit npm module and b) fork my friend Rachel's simple Twitter bot. If you don't have a Rachel in your life, you can look at and fork my bot!

The hard part of writing a Twitter bot is keeping it alive. You have these requirements:

your bot can't go to sleep (or else it stops talking to people)

your bot process needs to be easily killed (or else you can have multiple copies, all replying to the same people, in an alarming emoji conspiration)

your bot can't talk too quickly or too much (because Twitter has a very aggressive rate limit and will mute your bot)

Fear not, I broke all of those rules (badly), thus reinforcing my existing belief that I'd make a really shit ops person. At one point, I had 4 concurrent, unkillable zombie bots, all awake and bright eyed. I even got my bot banned for a weekend because I accidentally got it talking to itself in a loop, so it got marked as spam in a hot minute. I learned nothing from that, apparently, because the next week someone got a different bot talking to it in a loop, and we had to make our bots block each other to fix that. Woof. I don't really have any good advice for it other than "never be mean to an ops person again because their work is super hard and it's likely you'll suck at it."

Step 3: Hosting

I ended up trying a bunch of hosting providers, and learned some things. Mostly that there's actually no good solution for the "I don't need any CPU or space, I just need a process that stays alive" problem. There's a bunch of awesome and free providers (like Google Cloud) that don't work for bots, because they assume your process is woken up by something like an HTTP request. At least the way I wrote my bot, it doesn't. Anyway, here are my top picks:

Heroku is pretty easy to use, because deploying is just pushing to a remote git branch. Their free plan is kind of ok if you don't mind your bot sleeping every hour. If you do, you need to shell out $7 a month

now.sh is really awesome and free, but is only really useful if your process is stable. They host processes on a Kubernetes container, and once you "stop" your deployment, they don't actually kill the process -- they just block accessing it via HTTP requests. This works great for something like your personal site, but poorly for a twitter bot that just listens to stream events from Twitter. This way lie zombie bots.

Digital Ocean is a little cheaper than Heroku, but makes you install Node on your droplet instance and knowing myself, I saw this was going to go poorly so I bailed.

Step 4: Profit

Unleashing a silly emoji bot on Twitter was totally worth it. I saw it write poetry. I saw someone trying to see up its skirt. I saw everyone be silly and use emoji. A++, would bot again.