Skip to content

Latest commit

 

History

History
17 lines (9 loc) · 1.58 KB

README.md

File metadata and controls

17 lines (9 loc) · 1.58 KB

##Robot Shakespeare lives here!

##More info on the project

Source code for Robot Shakespeare, an automated twitter account which spits out some pseudo-Shakespeare every 30 minutes forever.

It works by using NLTK to analyze the complete works of one William Shakespeare and generate an n-gram model, i.e. a word-to-word transition probability model. It then generates snippets of occasionally beautiful prose by doing a random walk on the text using a Markov Model.

If you want to run it, you need NLTK to analyze and generate text, and tweepy to tweet. And you need your own twitter account/bot because this one is busy...

How to make your own twitter bot

This is well documented, but to create a twitter bot, you need to create a twitter account, then setup an application on Twitter devwith OAuth protocol. This link explains it pretty well minus the node.js stuff. Once you have the access token, you can very easily setup a python script which tweets to your new bot using tweepy.

Also handy... if you wish to let your script run indefinitely without generating a massive log file, you need to nohup it before you close your ssh session:

nohup python main.py  > /dev/null 2>&1&