My inner bot

The Real Shooby is a Twitter bot that mimics the messaging style of myself when I talk to my close friends. It analyzes over 150,000 messages that I have sent to my friend and uses a the Rita.js library to generate markov chain sentences. And through the use of the Twitter API, it can talk to any user who messages it. The majority of the time on this project was spent on working with large data sets. I definitely grew to be more comfortable working with them after this project.

I use Google Hangouts as my main messaging application when talking with my closest friends. Google provides a service called Takeout that allows any user to download their information, which includes their entire Hangouts history in a JSON format. My Hangouts JSON file ended up to be approximately 550mb (2 million lines), which was much more than what I expected.

The JSON file was a bit obtuse. And because it was so big, it was difficult for me to properly analyze it so that I could parse it myself. So I decided to find a tool to parse the JSON for me. The one I ended up using was this one: The problem with this tool is that it only accepts JSON files 500mb or less which meant that I needed to split my current JSON into smaller file sizes. This took a bit of time since I needed to understand the JSON’s data structure in order to not break the file.



After the tool parsed the JSON, it allowed me to download CSV files of each conversation. The ones that interested me were conversations that had the most messages sent which included my close friends and my ex-girlfriends. These CSV files ended up not being totally perfect. There were many things that disrupted the structure such as carriage returns, URLs, and weird emoticons that we liked to use. So I had to clean up these files as well, which led to a little bit of information lost.

I then used a csv-parse library to parse these CSVs. Because this project mainly focuses on my own messaging style, I only had to extract messages that I sent from these conversations. After compiling all of my messages, I noticed that my messaging style is not very conducive to analyze as complete thoughts. I like to message rapidly

in a sort of

stream of consciousness,


of like


So I also needed a way to determine complete thoughts. I ended up appending messages that I sent within 5 seconds of my last message. This was done by finding the difference of time in the timestamp of consecutive messages.

After I was satisfied with the final text file, I used the RiTa library to analyze the text with markov chains and generate sentences. The result was bizarre and familiar.

My main code Bot.js on digitalocean server, run with forever lib

For now, everytime someone DMs the bot, bot generates a sentence from markov chain and replies to the sender. The bot also refollows any user who follows it, allowing the user to easily DM to the bot after following.

I am definitely going to continue working on this bot. I would like to have the bot recognize key words in received messages and reply in a way so that it becomes more "conversational".

Bonus: here is a conversation my ShoobyBot had with Liarbot (a bot that tweets anything you DM it)

Talking Directly to the Elephant

To talk directly to the elephant I focused on laugh tracks. It reminded me of this video that somebody made to make fun of the TV show, The Big Bang Theory. Somebody took out the laugh track from one of its episodes and it turned it into an incredibly awkward stage play with terrible comedic timings.

Although the video is funny, I don't quite find it fair to judge a show's comedy solely based off this experiment. TBBT writes and edits the show with the laugh track in mind, so taking it out would be taking an integral piece out of a machine. I personally do not like TBBT, but I do not mind having a laugh track. One of the main reasons I enjoy going to the theaters is to experience a film within a large group of people. The social aspect of watching film or theater is incredible to me, so a laugh track is a crude yet effective way to simulate such an experience.

Most modern shows no longer utilize laugh tracks. It would be an interesting experiment to do the opposite of the video above by adding in laughs to a show without a laugh track. Although it would obviously disrupt the original intent of the show, much like taking away the laugh track from TBBT, it would be interesting to see if it actually adds or detracts from the show. 


Exposing ROY

I wanted to find a correlation between a person's heart rate and the moment when they find something funny. I used a heart beat sensor to detect my own heart beats while I watched a recent episode of It's Always Sunny In Philadelphia, a show that will often make me laugh aloud. In addition to measuring my heart rate, I also jotted down the time stamp of the show whenever I found something funny or shocking, so not necessarily whenever I'm "laughing out loud".

I found that the heart beat rate seems to only change when I am audibly laughing. There were several moments in the episode when something funny happened, but there was barely a change in the IBI. There were also many shocking moments in the episode where I think I audibly gasped, but that also did not seem to affect the heart rate enough to be noticeable. The IBI also seemed fairly consistent, going down to about 300 ms whenever I laughed. The highest my heart rate got to was about 105 bpm.

After my test results, my conclusion is that the heart beat seems to change only during more physical reactions. I hoped to find a more clear correlation between the actual moment of someone finding something funny and the heart, but it seems like I might need to use a different sensor to detect that. I also wish to do the same test with media that are less comedic but still bring up emotional responses from the viewer.


Self-awareness and self-discipline are both areas of interest for me. The first chapter of Stumbling On Happiness was a great read and expanded on both of these topics. Too many times have I done something so obviously detrimental to myself. I want to be able to control the disobedient elephant in my brain.

I'm not too sure what theory this would fall under, but I will definitely be reading more of Stumbling On Happiness. I also intend to check out the other books under the Illusion of Rationality category on the website.

Unconscious Data: Sensor

I plan on using a heartbeat/pulse sensor as my "unconscious data" sensor. I am curious to see how external forms of entertainment effect the heart rate.

Netflix and other online streaming services have been releasing entire seasons of their produced television shows at a time. Many of these shows tend to be binged immediately after their release. I wish to understand how each episode and season of these shows are structured in order to keep the viewers hooked by analyzing the data of the viewer's heartrate throughout their viewing.