I wanted to make a bot like this for some time now. Someone told me that I wanted to make a 'markov bot', so I wrote my own markov chain algorithm to analyze the tweets.
What it does
It takes the most recent 200 tweets from a user or several users, runs a markov chain on them, and returns the output.
How I built it
I built it with NodeJS , the Twitter REST API, and Electron to make a pretty GUI for the end-user.
Challenges I ran into
The twitter API module I am using runs its callbacks asyncronously. This was a problem as I have GET statuses/user_timeline in a loop so it runs as many times as there are usernames to fetch tweets for. However, since it runs async, I have to put the markov chain and tweet generation in the callback(and by extension, the loop) so that it would not return [undefined] because it completed before GET statuses/user_timeline
Accomplishments that I'm proud of
I'm proud of the fact that we had a good 5-10 minutes just laughing at the output of my program
What I learned
I learned how to use electron, what markov chains even are, and
What's next for automatically-generated-tweets
I hope to make the generated tweets make sense, and to screen them to make sure that they are not 1:1 copies of tweets a user has made.
Log in or sign up for Devpost to join the conversation.