5.1.0 • Published 8 years ago

twitter-scraper v5.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

TwitterScraper

Retrieve basic tweet data based on the specified query. Requires NodeJS 4+.

Usage

'use strict';

let stream = require( 'stream' );
let Scraper = require( 'twitter-scraper' ).Scraper;

let query = 'from:riccardovolo since:2015-05-01 until:2015-05-02';
let scraper = new Scraper( query );
let toConsole = new stream.Writable( {
  objectMode: true,
  write: function( tweet, enc, cb ) {
    console.log( 'Got tweet: ', tweet );
    return cb();
  }
} )
scraper.pipe( toConsole );

// Start the scraper
scraper.start();

Stream data

The data in the stream have the following format:

{
    "id": "123123131312",       // Tweet id as string
    "text": "tweet tweeeet",    // Text
    "timestamp": 123123123,     // Unix seconds
}

Options

The start method can accept 2 parameters first and last

Debug

The lib uses the debug lib (see here) use the DEBUG env variable to control the logs.

License

http://www.wtfpl.net/

5.1.0

8 years ago

5.0.0

8 years ago

4.2.1

8 years ago

4.2.0

8 years ago

4.1.0

8 years ago

4.0.0

8 years ago