Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm's 300,000 packages pre-installed, including tweet-collector with all npm packages installed. Try it out:

var tweetCollector = require("tweet-collector")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

tweet-collector v2.1.1

Simple periodic tweet collector

Tweet Collector

Simple periodic tweet collector.

npm install --save tweet-collector
var TweetCollector = require('tweet-collector');
var tweetCollector = new TweetCollector(twitterCredentials, {
  batch_size: 100,
  interval: 10, // seconds
  search_params: {
    q: 'comma,separated,keywords'
  }
});
tweetCollector.start();
tweetCollector.on('fetch', function(tweetsArray) {
  console.log(tweetsArray);
});

API

TweetCollector(twitterCredentials, settings)

Instantiate a TweetCollector.

Example:

var tweetCollector = new TweetCollector(twitterCredentials, settings);

search_params

See Twitter API Docs.

tweetCollector.start(searchParams)

Start tweet collector.

tweetCollector.stop()

Stop tweet collector.

tweetCollector.on('fetch', onTweetFetch)

tweetCollector.on('fetch', function onTweetFetch(tweetsArray) {
  console.log(tweetsArray);
});

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free