Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Connect to Gnip streaming API and manage rules. You must have a Gnip account with any data source available, like Twitter Power Track.
Currenly, this module only supports JSON activity stream format, so you must enable data normalization in your admin panel.
This class is an EventEmitter and allows you to connect to the stream and start receiving data.
Connect to the stream and start receiving data. At this point you should have registered at least one event listener for any of these events: 'data', 'object' or 'tweet'.
Terminates the connection.
Emitted when the connection has been successfully established
Emitted for each data chunk (decompressed)
Emitted when any type of error occurs. An error is raised if the response status code is not 20x. {error: String} objects are also checked here.
Emitted for each JSON object.
Emitted for each tweet.
Emitted for each deleted tweet.
Emitted when the connection is terminated. This event is always emitted when an error occurs and the connection is closed.
This class allows you to manage an unlimited number of tracking rules.
Get cached rules.
Creates or replaces the live tracking rules.
Rules are sent in batches of 5000 (API limit), so you can pass an unlimited number of rules.
The current tracking rules are stored in a local JSON file so you can update the existing rules efficiently without having to remove them all.
The callback receives an object as the 2nd argument and contains the number of added and deleted rules.
Clears cached rules.
npm install gnip
var Gnip = require('gnip');
var stream = new Gnip.Stream({
url : 'https://stream.gnip.com:443/accounts/xxx/publishers/twitter/streams/track/prod.json',
user : 'xxx',
password : 'xxx'
});
stream.on('ready', function() {
console.log('Stream ready!');
});
stream.on('tweet', function(tweet) {
console.log(tweet);
});
stream.on('error', function(err) {
console.error(err);
});
var rules = new Gnip.Rules({
url : 'https://api.gnip.com:443/accounts/xxx/publishers/twitter/streams/track/prod/rules.json',
user : 'xxx',
password : 'xxx'
});
var newRules = [
'#hashtag',
'keyword',
'@user',
{value: 'keyword as object'},
{value: '@demianr85', tag: 'rule tag'}
];
rules.update(newRules, function(err) {
if (err) throw err;
stream.start();
});
More details and tests soon...
FAQs
Connect to Gnip streaming API and manage rules
The npm package gnip receives a total of 93 weekly downloads. As such, gnip popularity was classified as not popular.
We found that gnip demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.