Coder Social home page Coder Social logo

gnippy's Introduction

Gnippy

A Node.js client for consuming Gnip. Connect to the Gnip Powertrack Streaming API and manage your rules. You must have a Gnip account with Twitter PowerTrack available and enabled.

Gnippy.Powertrack.Stream

The stream is an EventEmitter that allows you to connect to a PowerTrack stream and start receiving data.

API Methods

stream.start()

Connect to the stream and start receiving data from Gnip. You should have registered at least one event listener for any of the following events from the stream:

  • data
  • share
  • post

stream.end()

Terminates the connection to the stream.

Events

Event Name Description
data Emitted for each content item received.
error Emitted when the response received is not a 200 OK.
end Emitted when the stream has been ended.
post Emitted for each content item received that has a verb value of post.
share Emitted for each content item received that has a verb value of share.

Installation

npm install gnippy

Example Usage

var Gnippy  = require('gnippy');

var powertrack_options  = {
  account_name: "<your Gnip account name>",
  user:         "<your Gnip user name>",
  password:     "<your Gnip password>",
  stream_name:  "<your Gnip Powertrack Stream name, ex. 'prod'>"
};

var stream  = new Gnippy.Powertrack.Stream(powertrack_options);

stream.on('error', function(err){
  console.error(err);  
});

stream.on('data', function(data){
  console.dir(data);  
});

stream.on('post', function(data){
  console.dir(data);  
});

stream.on('share', function(data){
  console.dir(data);  
});

stream.start();

=== Tests and details to follow soon....

gnippy's People

Contributors

michaeldelorenzo avatar

Watchers

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