How it works
Suppose we have two tweets we want to mash up. One tweet says: "I don't like to worry about spiders" while the other says "Sometimes I worry that I am a ghost." We can mash the two tweets together by combining them from the word "worry." We take the words to the left of the word "worry" in the first tweet ("I don't like to") and the the words to the right of "worry" in the second tweet ("that I am a ghost") and combine them "I dont like to worry that I am a ghost". Tweet Mashup works by doing this in an efficient manner. In more detail:
- For two users do the following:
- Download a set of their tweets
- For each tweet, take each word in the tweet and store how many characters it is into the tweet.
- Create a dictionary that has, for each unique word, an array of the tweets and positions the word falls in.
- Take the two tweet-word dictionary, and find the words that are in both of them.
- Randomly pick a word from the set of words in both dictionaries.
- Randomly choose an instance that word shows up in a tweet from each user, and randomly choose which user will be the beginning half of the mashed-up tweet, and which will be the ending half.
- Combined these together to make one tweet.
How it was programmed
It was programmed using the functional programming language F#. The tweet API functionality was from Tweetinvi and the web server capability from WebSharper. The code is open-source and available on GitHub.
Jonathan Adler is an advanced analytics expert and amateur software developer. Jess Eddy is a user experience consultant and digital product designer.