I wrote a bot that replies to people’s tweets in the style of Supa Hot Fire. While the primary goal was dank memes, it also served as a nice introduction to natual language processing and the Twitter API.
nothing: I regret that. @AubriasV
— Supa Bot Fire (@supabotfire) June 3, 2015
Update: The bot got banned. RIP in peace.
How it works
When running, the bot gets a stream of tweets containing ‘I’ or ‘we’ via Twitter’s streaming API. It looks for tweets in the stream in the format of a personal pronoun followed by a verb (for example “I like turtles”). When it gets a hit, it restructures the sentence (“Turtles: I like that”) and tweets it back at the tweeter. Then it chills out for up to an hour.
It uses Tweepy as a Twitter API wrapper and NLTK to chunk and tag tweets.