OK, you want to talk bots? Let’s talk bots! First, let’s go back…
WAAAAAY back. A few weeks ago, I got a nice mention on Twitter from a procrastinating grad student who found my tutorial and used it to set up Ecce @pubsyr, a Publilius Syrus twitterbot (I had to wikipedia that).
— Patrick J. Burns (@diyclassics) April 4, 2015
Den is currently working on bot #2, a Virgil fortune telling bot, while also working full-time and raising two kids. *Living the dream.*
I’m pretty sure my Twitter bot is now stable, and I’ve learned so much about NodeJS, Git, and Heroku in the process.
— Den McHenry (@DenMcH) April 11, 2015
Tell me about it!
Both these programmers ran into the same problem with Heroku that I had, where the daily reboot “breaks” the original code. What’s more, Patrick (programing in Python) tried the file trick I was thinking about (open file, read line, tweet line, delete it from source file, close file, repeat) and discovered that the read/write strategy doesn’t work due to Heroku’s ephemeral file system.
What does work? Randomization. So, their Latin and Greek bots tweet random lines. And now, so does mine:
It’s been such a treat to watch all this play out in the last couple weeks, even though I haven’t had much time to participate. It’s exactly what I hoped would happen by posting my process and tutorial: that people would find, mimic, and build. And in doing so, they helped me improve/fix my own program (albeit, not the fix I was hoping for). And the fact that it was done in ancient Latin and Greek is both hilarious and totally inspiring to me. So BIG THANKS to Patrick and Den! Now who’s going to write a modern translation bot for us non-ancient-language-reading losers? & thanks to Joel for helping me get it all launched in the first place. More to come!
One last thing, behold the power of the bot (this one a Harry Potter sorting hat bot):
This is part 3 of the tutorial.
Part 1: Build a Twitter Bot with Python
Part 2: Finishing the Bot