Tweet mashup!

Combine tweets from two Twitter accounts for one awesome tweet!

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:

  1. For two users do the following:
    1. Download a set of their tweets
    2. For each tweet, take each word in the tweet and store how many characters it is into the tweet.
    3. Create a dictionary that has, for each unique word, an array of the tweets and positions the word falls in.
  2. Take the two tweet-word dictionary, and find the words that are in both of them.
  3. Randomly pick a word from the set of words in both dictionaries.
  4. 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.
  5. 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.

About us

Jonathan Nolis is an advanced analytics expert and amateur software developer. Jess Eddy is a user experience consultant and digital product designer.