My boyfriend and I have something we call the “David Eddings Game”, where we make up the silliest, most generic fantasy book titles. Stuff like “The Dragon’s Quest” or “The Mage’s Folly”. Its just based on a sequence of “A-Something’s-Something”, so I thought that it would be pretty neat to make a bot that plays this game.
I created a .csv database of fantasy words, then created a script that would make random sentences out of them.
I had four classes – word, sentence, database and generator. From sentence I created three instances of word, one for each row in my csv, and combined them into a sentence. In generator, I used sentence but used some of the functions defined in database to check whether the string had already been created and skip if if so.
I then created an account and app for my bot on twitter, had my script create the api and then every time it is run, generate a random sentence and tweet it. A lot simpler than I imagined it would be!