Book Image

Mastering D3.js

By : Pablo Navarro Castillo, Pablo Navarro Castillo
Book Image

Mastering D3.js

By: Pablo Navarro Castillo, Pablo Navarro Castillo

Overview of this book

Table of Contents (19 chapters)
Mastering D3.js
About the Author
About the Reviewers

Creating the streaming server

In this section, we will use Node to create the streaming server. The server will handle the client connections and the connection to the Twitter-streaming API; it will also manage the list of topics for all the clients who deliver tweets as they arrive.

We will begin by creating Twitter authentication tokens; we will learn how to use the Twit module to manage the connection to the Twitter API, and how to use Socket.IO to handle real-time communication between the server and the client application.

To follow the examples in this section, open the chirp-server project directory in the terminal and run the following command to install the project dependencies:

$ npm install

This will create the node_modules directory and download the project dependencies. If you haven't installed Node, download the binaries for your platform from and follow the instructions on the page.

Using the Twitter-streaming API

Twitter provides a streaming API that...