Mary Dickson Diaz

Code, Life, Learning

top bot

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 , a Publilius Syrus twitterbot (I had to wikipedia that).

Patrick runs diyclassics.com, so if you are interested in learning about spoken Latin, go give his site a read. But that is all the publicity he’s going to get from me, because dude should be writing his dissertation. Go Patrick go! Write write write! Patrick’s bot attracted the attention of ANOTHER digital humanities scholar, this one here in Seattle, who runs the CAMPVS, a blog about Greek, Latin, & Classical Humanities. Den compiled a variety of tutorials and code to make his own twitter bot, Disticha Catonis, (here, let me wikipedia that one for you as well) this one using JavaScript instead of Python.

Den is currently working on bot #2, a Virgil fortune telling bot, while also working full-time and raising two kids. *Living the dream.*

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:

Screen Shot 2015-04-15 at 10.41.23 AM

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!

Resources:

Disticha Catonis: twitter | github | author

Pubsyr Bot: twitter | github | author

***

One last thing, behold the power of the bot (this one a Harry Potter sorting hat bot):

Proceed and be sorted!

UPDATE 6/25/15

This is part 3 of the tutorial.

Part 1: Build a Twitter Bot with Python

Part 2: Finishing the Bot

2 Comments

  1. Hi Mary,

    Thanks for writing this up. I actually didn’t run into that problem. I had intended from the start to randomize the tweets. I thought it suited Twitter, where people rarely go through timelines but read things as they come. I liked the idea of just having random snippets of Latin appearing in my timeline, and I’ve enjoyed reading them when I see them. It also helps to keep the code more manageable (i.e., simpler).

    I like that you mentioned one of Darius Kazemi’s bots at the end. I had been looking at his work for a while and thinking about trying to make my own bots, but always felt like there was something else I should be doing instead (work, housework, yard work, blergh). I’ve been studying JavaScript through FreeCodeCamp and have done a bit with Node, which is what Darius uses, so when I saw what you and Patrick did, I thought I shouldn’t wait any longer and should just do it already.

    I looked at the source of a lot of his bots in figuring out how to make mine. He’s really great in that he’s interested in promoting creative code, even publishing sub-optimal code himself if he thinks it’s more readable and helpful for people trying to learn from his work.

    And the second bot (@LotsByVergil, tweeting ‘oracular’ responses from Vergil’s Aeneid) is live:

    https://twitter.com/LotsByVergil/with_replies
    https://github.com/denmch/sortes

    • Hi Den, thanks for commenting! You’re right, Darius has some terrific resources. I used his example code as a template for a JavaScript twitter bot (more to come on that), and I added it plus many other links (including yours) to a central bot page — hopefully this will help organize resources for other people wanting to get started. Link: http://marydickson.com/bots/

Leave a Reply

© 2017 Mary Dickson Diaz

Theme by Anders NorenUp ↑