Skip to content

Twitter Streaming Server - Example for the book Mastering D3.js

License

Notifications You must be signed in to change notification settings

pnavarrc/chirp-server

Repository files navigation

Chirp Server

Twitter Streaming Server. Example for the book Mastering D3.js.

Installing

To run the code in this repository, you will need Node, Twit, Socket.IO and Twitter credentials. To obtain the Twitter credentials, go to Twitter Developers Site, create an application and create access tokens for your application. You will need the consumer key, consumer secret, access token and access token secret and replace the values in the file credentials.json.

The dependencies on this project can be installed from the command line by typing:

$ npm install

Running the Streaming Server

Update the chirp.js file to use your credentials (be sure to keep the credentials secret) and run the streaming server:

$ node chirp.js

The server will connect to the statuses/filter endpoint and begin listening the port 9720 for socket.io connections.

Examples

There are examples of using the Twitter Streaming API and the Socket.IO library. To run the examples, execute the corresponding script in the terminal:

$ node 01-twitter-sample.js

The third example requires to open the socketio-example.html with the browser.

About

Twitter Streaming Server - Example for the book Mastering D3.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published