twitter-rate-limit
v1.0.1
Published
Extends the twitter client with the respect of rate limits
Downloads
5
Readme
twitter-rate-limit
Extends the twitter client with the respect of rate limits
Install
$ npm install --save twitter-rate-limit
Usage
var Twitter = require('twitter');
var twitter = new Twitter({
consumer_key: '',
consumer_secret: '',
access_token_key: '',
access_token_secret: ''
});
var twitterRateLimit = require('twitter-rate-limit');
twitterRateLimit(twitter, 1000 * 60 * 5);
API
twitterRateLimit(twitter, [wait], [onlimit])
Type: Twitter
Instance of the twitter module Twitter class.
wait
Type: number
Default: 300 000
(5 min)
Time (in ms) to wait if twitter response with a 429 (to many requests) response
onlimit
Type: Function
Function to call if a wait occured
License
MIT © Viktor Braun (v_b)