Trump Tweet Generator

Inspiration

Wanted to mess around with some natural language processing algorithms and the Twitter API, and do something with random text generation.

What it does

Generates and posts a tweet that simulates how Donald Trump sounds

How we built it

Scrapes Trumps most recent 240 tweets, as well as the abstracts from the current top New York Times political stories and combines them with transcripts from a few trump speeches to generate a corpus that is used to generate bi-grams and stores them in a markov chain. To generate the tweet, a random word is selected from the corpus, then we search the markov chain for that word, and then picks one of the children from that node as the next word. This process is repeated until a sentence fits in tweet is formed. Then, the resulting tweet is posted to a Trump themed Twitter account (@xXTweeter420Xx). A simple webpage was set up that includes the Twitter feed as a widget and lets whoever visits the page click a button to generate and post a tweet.

Challenges we ran into

Some issues with unicode encoding when trying to set up a server for demo webpage on AWS

Accomplishments that we're proud of

The tweets that the simulator generates ended up being pretty interesting