Skip to content

Online Implementation

fmalinowski edited this page Mar 18, 2015 · 4 revisions

ServerRunner Takes care of hosting the static content, and handles any requests from the client end. So these duties include not only registering front end requests, but also handling the response and initiating the processing involved in searching through tweets by calling upon methods that will be detailed in the following sections.

HashtagQueryProcessor Processes the hashtagQuery as the name indicates. Responsible for calling the methods necessary to both sort the sortedHashtagGraph, as well as then return the edges and nodes in JSON format for d3js to render.

TwitterRest This class contains the bulk of the methods required to retrieve tweets from Twitter, via the Twitter4J library. It provides a method twitterSearch(), which actually uses the user's query in order to create a filter by which only relevant tweets are extracted. These tweets are then examined for matches with more than one hashtag, and then are filled into a HashMap. The key of the HashMap is determined by the hashtag searched for, with the value being corresponding edges for that hashtag in question (other hashtags that also had the original search hashtag in the same query). Next, the handleSearch() function which actually uses twitterSearch() is then able to loop through the HashMap in order to properly assign nodes and their corresponding edges to the sortedHashtagGraph. This is done by first checking to see if the node or edge is previously existing; if it does already exist, it is not re-added. Instead, the node or edge weight is incremented in order to later help d3 determine how nodes and edges are scaled.

TwitterStream Fully implemented in order to do the same as TwitterRest. However, due to Twitter streaming API limitations, it is unable to operate with a full cycle since the number of queries is too high, resulting in a temporary ban.

A few pictures of the online mode:


General overview of the query "StPatricksDay"


Graph Info window for the query "StPatricksDay"


Over the node "StPatricksDay" for the query "StPatricksDay"


Over the edge between "Green" and "StPatricksDay" for the query "StPatricksDay"

Clone this wiki locally