Tuesday, March 29, 2016

Presidential Candidate Twitter Bot

I set up a Twitter bot to say presidential things.


Currently, it uses tweets from Trump, Cruz, Clinton, and Sanders as its corpus. I want to compare and contrast the content it produces to the rest of the political elite to see how it stacks up. 

I figure it's got a 50/50 on being better or worse.

Why?



Much of modern political debate is pithy one-liners fit for reality television, so this just seems to make sense. With so many jobs being "disrupted" by tech, political debate seems like a logical next industry.

In the future, I assume the Presidential position will be filled by a bot that uses the combined tweets of congress as its input. And perhaps, eventually, the congressional representatives will simply be bots pulling content from their constituents.

How?



My previous bots (like The Peterbot) used the python NLTK library and the awesome command-line Twitter client "t". This was a good option when my primary input was blogs and websites, but was sort of a pain to get working properly with Twitter feeds.

I've since migrated to the popular twitter_ebooks gem and set up a daily cron job to update the corpus.



The horrifyingly presidential picture was made with Morph Thing.