GithubHelp home page GithubHelp logo

puppycodes / node-tweet-stream Goto Github PK

View Code? Open in Web Editor NEW

This project forked from spiderstrategies/node-tweet-stream

0.0 0.0 0.0 75 KB

Node twitter module to hook into the public filter streaming, seamlessly updating the tracking keywords.

JavaScript 100.00%

node-tweet-stream's Introduction

Node Tweet Stream

node-tweet-stream is node twitter module that connects to the public twitter stream. It does not provide endpoints to the REST API. There are other fine node modules that provide this functionality. It doesn't connect to twitter's user streams, since they are useless unless you're writing a mobile app. It also doesn't allow you to connect to site streams, since you probably don't have access to that anyway.

It does provide a nice API for working with public streams, allowing you to track and untrack a list of keywords, updating the public stream behind the scenes.

Installation

npm install node-tweet-stream

Usage

This code will probably be used at an application level, not a user level because of the twitter API restriction. That said, you need to grab a twitter access token key and secret, because the streaming API doesn't support bearer tokens. This is a limitation of twitter, not this project. If twitter provides bearer token access to their streaming API, we can improve this.

var Twitter = require('node-tweet-stream')
  , t = new Twitter({
    consumer_key: '',
    consumer_secret: '',
    token: '',
    token_secret: ''
  })

t.on('tweet', function (tweet) {
  console.log('tweet received', tweet)
})

t.on('error', function (err) {
  console.log('Oh no')
})

t.track('nodejs')
t.track('pizza')

// 5 minutes later
t.track('tacos')

// 10 minutes later
t.untrack('pizza')

Watch yourself when updating your tracking keywords. Twitter has guidelines for connection rate limiting.

Backoff strategy ripped from https://github.com/benfoxall/tweets/

License: MIT

node-tweet-stream's People

Contributors

aboutvale avatar alegrm avatar atticoos avatar djelic avatar methodgrab avatar michmich avatar nathanbowser avatar nkzawa avatar rauchg avatar robturtle 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.