Creating a Twitter explorer application

In this section, we will create an application to explore the distribution of geotagged tweets at a given time. Users can enter topics in the input box. The topics will be sent to the server-side application, which will begin to send tweets that match the topic to the client-side instance of the corresponding user. This application can be used to track the geographic distribution of a set of topics. For instance, a user might be interested to know which kind of meal is being discussed in different regions of the world, to monitor the Twitter stream for earthquake-related words, or to track the mentions of a particular brand. Our application will support multiple users to be connected at the same time, allowing each user to add up to five topics.

A screenshot of the client application is shown as follows:

Creating a Twitter explorer application

Our application will consist of two components, the streaming server and the client-side application. The streaming server will handle the connection with clients, a global list of topics to track, connect to the Twitter-streaming API, and deliver tweets that match the topics to the corresponding client. When a client disconnects, the server will remove the client's topics from the topics list. We will implement the streaming server in Node using Socket.IO to handle the connection with the user and send them tweets, and the Twit module to handle the connection to the Twitter-streaming API.

The client-side application will establish the connection with the streaming server, send new topics as they are added, and update the bar chart and the map components. We will use Backbone, Bootstrap, Socket.IO, and D3 to implement the client-side application.

We will begin by learning how to use the Twitter-streaming API and Socket.IO to implement the streaming server and then implement the client application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset