Twitter bubbles

The Twitter bubble-gun application portrays the strength of feeling on given Twitter topics with the help of the HP IDOL OnDemand cloud services.

Individual tweets are represented by bubbles emitted from bubble guns or bubble clouds. The size and colour of individual tweets is determined by sentiment strength returned from the HP IDOL OnDemand Sentiment API. The application is intended for a large wall display so viewers can judge overall mood on hot topics at a glance.

This is a Windows desktop application written in C#, .NET and WPF.  It makes use of Tweetinvi  to access Twitter and create a Tweet stream which is then piped through the HP IDOL OnDemand sentiment API and on to the bubble emitters. Movement of the bubbles is controlled by the Farseer physics engine. User interaction with bubbles and controls is managed by the Tangible Apps touch framework.

The bubble gun is the main emitter of twitter bubbles and each can have a different Twitter search phrase consisting of key words ANDed and ORed together. An on-screen multi-touch keyboard is used to enter and edit the search phrase phrase. The multi-user nature of the Tangible Apps framework allows multiple bubble guns to be positioned and configured simultaneously which is especially useful for very large display screens. No queuing to use this application!

multi-touch keyboard

Setting Twitter search phrase with on-screen keyboard.

There are two types of bubble gun with associated different types of bubble: text or image.

  • A text bubble contains the Twitter user icon plus the text of the tweet. Tapping a text bubble causes the text to be displayed in a larger, static window. If there is an image associated with the Tweet, this is displayed next to the text.
  • An image bubble is only generated if there is an image associated with a Tweet. In this case, the bubble contains the image rather than the text. Tapping an image bubble causes the image to be displayed in a larger, static window where it can be resized and cropped for other purposes.
Static review screens for Tweet and image bubbles

Static review screens for Tweet and image bubbles

The colour and size of bubbles is determined by the IDOL OnDemand sentiment API. The text from each Tweet is posted up to the API which returns:

  • a list of phrases extracted from the text and used to judge the sentiment. Each phrase contains the word used to determine the sentiment, the object of the sentiment and the sentiment value and strength.
  • the aggregate sentiment value and strength

This application uses the aggregate value.
Sentiment is expressed as “positive” or “negative” and the strength is a number between -1 and +1, where -1 is totally negative and +1 is totally positive. Zero indicates neutral sentiment.
Bubbles associated with positive tweets are tinted green and bubbles associated with negative tweets are tinted red.
The stronger the sentiment the larger the bubble and hence the slower it moves. Hence, neutral Tweets tend to exit the desktop faster while the more interesting Tweets linger.

Bubble size and colour varies by strength of sentiment

Bubble size and colour varies by strength of sentiment

If a topic is very popular, the number of Tweets received can easily swamp the application. Tweet request and processing and IDOL OnDemand requests are all handled on background threads. In addition, new Tweets are buffered and queued for processing by the rest of the pipeline. At any given moment, only the latest 500 Tweets are retained and the remainder are disposed of.

When a bubble-gun creates bubbles in rapid succession, individual bubbles become lost as they are hidden by subsequent bubbles. The bubble cloud is an attempt to overcome this by increasing the number of nozzles through which bubbles on a given search are emitted. A bubble cloud has a fixed nozzle per unit length so increasing the length of a cloud increases the total number of nozzles available. Each new bubble is emitted through a randomly selected nozzle.

Bubble cloud distributes bubble creation avoiding over-crowding

Bubble cloud distributes bubble creation avoiding over-crowding

 

This application was used at a HP IDOL OnDemand innovation party in San Francisco so there was a branding element. IDOL OnDemand icons could be made to float about the screen at random. These icons then emitted further icons – inspired by the scene in Disney’s Wall-E where the little robot propels himself through space with a  fire extinguisher.

IDOL OnDemand logo used for branding

IDOL OnDemand logo used for branding