Giter VIP home page Giter VIP logo

twitter-streaming-socketio's Introduction

twitter-streaming-socketio

Example ExpressJS application that uses SocketIO and Bootstrap to show a steady stream of nearby tweets

Demo

demo

Setup

This project uses the twit NPM module to utilize the Twitter Streaming API, so you will need to register a new app at apps.twitter.com and get a consumer key and access token (this is free).

Once you have an app registered with Twitter, create a file called config.js in the project root (this is already gitignored) add the following keys:

module.exports = {
    consumer_key: 'REQUIRED'
  , consumer_secret: 'REQUIRED'
  , access_token: 'REQUIRED'
  , access_token_secret: 'REQUIRED'
}

Once you have your keys and tokens in your config.js, you're ready to start the application:

npm install
bower install
npm start

The application can be viewed at http://localhost:3000

Customize

When you first start this application, you will see tweets from Champaign, Illinois. To see tweets near you, update index.js to the coordinates of your location.

Twitter expects this to be an array of coordinates, starting in the Southwest corner, and ending in the Northeast corner (more info on dev.twitter.com). You can also use geojson.io to easily identify nearby coordinates.

Note that this is a single array with four elements, not a polygon or nested array of points. Several sample locations are provided.

// Champaign-Urbana, Illinois, USA
var location = [ '-88.45', '40.04', '-88.10', '40.19' ];

// Chicago
var location = [ '-87.79', '41.71', '-87.63', '42.02' ];

// San Francisco
var location = [ '-88.45', '40.04', '-88.10', '40.19' ];

// NYC
var location = [ '-74.02', '40.69', '-73.93', '40.79' ];

// London
var location = [ '-0.18', '51.47', '-0.00', '51.55' ];

// Tokyo
var location = [ '139.18', '35.36', '140.13', '35.93' ];

twitter-streaming-socketio's People

Contributors

brock avatar dependabot[bot] avatar

Stargazers

Brad avatar Samuel Brown avatar

Watchers

 avatar James Cloos avatar  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.