Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
/ gnippy Public archive
forked from michaeldelorenzo/gnippy

Node.js client for Twitter enterprise Data APIs (ak Gnip 2.0)

License

Notifications You must be signed in to change notification settings

andypiper/gnippy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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....

About

Node.js client for Twitter enterprise Data APIs (ak Gnip 2.0)

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Languages

  • JavaScript 100.0%