Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chirp-stream

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chirp-stream

twitter streaming apis in nodejs

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

chirp-stream Build Status

NPM version Dependency Status

Coverage Status Code Climate

twitter streaming apis in nodejs

Installation

npm i chirp-stream --save

Usage

var twitter = Chirp({
    consumer: {
        public: 'xxxxx',
        secret: 'xxxxx'
    },
    token: {
        public: 'xxxxx',
        secret: 'xxxxx'
    }
});

var userstream = twitter.stream('https://userstream.twitter.com/1.1/user.json');

userstream.on('data', function(data) {
    console.log('data');
    console.log(data);
});

userstream.on('json', function(json) {
    console.log('json');
    console.log(json);
});

userstream.on('end', function() {
    console.log('end');
});

userstream.on('error', function(error) {
    console.log('error');
    console.log(error);
});

Example

Public streams

statuses/filter
var userstream = twitter.stream('https://stream.twitter.com/1.1/statuses/filter.json', {
    data: {
        follow: 61260444 //me :)
    }
});
//listen to events...
statuses/sample
var userstream = twitter.stream('https://stream.twitter.com/1.1/statuses/sample.json');
//listen to events...

User streams

var userstream = twitter.stream('https://userstream.twitter.com/1.1/user.json');
//listen to events...

Option

  • consumer: Object Twitter app public and secret consumer.
  • token: Object Client public and secret token.

API

.stream()

create a stream

options
  • url: String Twitter endpoint
  • method: String default GET
  • param: Object Twitter parameters
return

streaming object

event
  • data: String twitter raw data. Beware: there are some incomplete data
  • json: Object twitter data Use this instead of data
  • error: status code (404, 503, ...)
  • end

Keywords

FAQs

Package last updated on 26 May 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc