We wanted to use natural language processing for our project and to make a good project we needed a wealth of data which we collect from Twitter. Once we'd gathered some interesting statistics we wanted to make something pretty!

What it does

A Twitter user name is given by the user and recent posts from that user are used to create a graph of how positive their messages are.

How we built it

When the Twitter username is submitted a socket is opened. We use the Twitter API to collect recent posts from that user which are then sent of to Google natural language processing API. The result from this is two metrics called polarity (how positive the message contents is) and magnitude (how strong the language used is) as well as a list of mentions of other Twitter users. This information is then sent via a socket connection back to the user where WebGL is used to graph the results using WebGL (via the ThreeJS library).

Challenges we ran into

The nature of the Twitter and Google APIs made it very difficult to pass data between the two and then reunite the results with the original Tweets. Half of the team had never used JS before and none of us had any experience with Web/OpenGL which was made worse by the lack of documentation for some areas of ThreeJS.

Accomplishments that we're proud of

Data makes it reliably from Twitter -> Google -> User and does so relatively quickly. Client side drawing of interactive graph looks great! Despite being build quickly the whole project is built in such a way that we could fairly quickly implement other features (see What's next...).

What we learned

WebGL, Javascript, lots about asynchronous connections and more ninja git shell skills!

What's next for The Twitter Sphere

If the socket connections was held open after the initial data is sent then the user's graph could be updated with new posts in (near) real time. We could also allow for the graph to expand beyond one step away from the original user name entered. More animations for the graph using the huge amount of data available to drive pretty (but also insightful) animations.

Share this project: