Giter VIP home page Giter VIP logo

twitternodesocketexample's Introduction

TwitterNodeSocketExample

An example application connecting to Twitter Streaming API, and then sending results to HTML page using socket.io

To Use

To run: use either node or forever start

e.g.

node app/NodeServer.js

To Configure

Server

Note: You need to enter your Twitter Client credentials (public key, secret key, access token) in order to enable the stream to run.

  1. Go to http://dev.twitter.com and create a new application.

  2. Once you have obtained your credentials, edit the NodeServer.js file:

var T = new Twit({
    consumer_key:         'REQUIRED'
  , consumer_secret:      'REQUIRED'
  , access_token:         'REQUIRED'
  , access_token_secret:  'REQUIRED'
});

The 'REQUIRED' variables need to be repaced with your Twitter credentials.

Client

You need to edit the client javascript file in order point to the server address.

  1. Navigate to your Git repository and edit the file by:
vi client/js/index.js
  1. Replace the following like with your server address:
var socket = io.connect('http://ServerAddress:9001');
  1. Now either copy the entire client folder into your /var/www/ folder, or create a symbolic link to the `client/' folder

Live Demo

For a live demo, go here: http://jxt0.ecs.soton.ac.uk/twitter

Dependencies

Server

This node application requires the following Node Packages.

  • HTTP Server
  • Node.JS
  • Socket.io
  • Twit

To install these, please use the NPM (Node Package Manager). e.g.

sudo npm install -g socket.io

Client

In order to access the Web client, you need to install Apache2. In order to do this, please run the following as sudo:

sudo apt-get update
sudo apt-get install apache2

twitternodesocketexample's People

Contributors

raminetinati avatar

Watchers

Jas C avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.