Skip to content

Volox/TwitterScraper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 84.4%
  • JavaScript 15.6%