wikidata-changes-stream

0.0.1 • Public • Published

wikidata-changes-stream

Create node streams of change event objects from Wikidata's RecentChanges API.

createChangeStream()

Create a stream of change event objects from Wikidata.

createEntityStream()

Transform stream that requests full entities from change event objects.

Example

Stream the last 60 seconds of changes from Wikidata.

var wcs = require('wikidata-changes-stream');
 
var changes = wcs.createChangeStream({
    start: (+new Date)/1000 - 60,
    end: (+new Date)/1000
});
 
changes
    .pipe(wcs.createEntityStream())
    .on('data', function(obj) {
        console.log(JSON.stringify(obj));
    })
    .on('error', function(err) {
        console.error(err);
    });

/wikidata-changes-stream/

    Package Sidebar

    Install

    npm i wikidata-changes-stream

    Weekly Downloads

    3

    Version

    0.0.1

    License

    ISC

    Last publish

    Collaborators

    • yhahn