Code Monkey home page Code Monkey logo

twitter-cashtag-heatmap's Introduction

Refactor of thedillonb's Node + Twitter Streaming API (in coffeescript)

I was looking at Dillon's Node + Twitter Streaming API code at the same time as Peepcode's Full Stack Node.js screencast.

I refactored dillon's demo in the peepcode cast's style, minus tests and a bunch of other things to get just the most basic pattern. The result is more extensible for modular future application development than putting everything in app.js

https://github.com/thedillonb/twitter-cashtag-heatmap

http://www.dillonbuchanan.com/programming/node-js-twitter-streaming-api-socket-io-twitter-cashtag-heatmap/

https://peepcode.com/products/full-stack-nodejs-i

Some Different Things

  • installed, required coffeescript
  • left server creation as it is in the express 3.4.0
  • installed node-dev and executable script, ./node_modules/.bin/node-dev app.js restarting server on file saves (/bin/devserver must be executable)
  • created apps/routes.coffee to handle only route
  • configured socketio in separate file (may need sudo to start if you get listen EACCES error)
  • put twitter in its own file, placing watchList and watchSymbols on app.settings (although there are better ways to do this)
  • client side gets a complete coffeescript treatment (assets/js/application.coffee), tied together by connect-assets (back in app.js) to serve static javascript
  • as in dillonb's tut, you'll need to enter your own twitter authentication info

Now, if you want to extend towards user authentication and something like, adding and deleting the twitter watch items from a database linked to the current user, as in the Peepcode tut, things are architected more similarly.

To Run Project

  • clone this repo
  • npm install to get dependencies
  • get your twitter credentials and enter them into apps/twitter-stream.coffee
  • run ./bin/devserver (should be executable and run as admin)

Screenshot

Screenshot

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.