@mapbox/wikidata-changes-stream

0.1.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);
    });

Readme

Keywords

Package Sidebar

Install

npm i @mapbox/wikidata-changes-stream

Weekly Downloads

7

Version

0.1.1

License

ISC

Last publish

Collaborators

  • mbx-npm-ci-production
  • mbx-npm-ci-staging
  • mbx-npm-advanced-actions-production
  • mbx-npm-advanced-actions-staging
  • mbx-npm-09-production
  • mbx-npm-08-production
  • mbx-npm-07-production
  • mbx-npm-06-production
  • mbx-npm-05-production
  • mbx-npm-04-production
  • mbx-npm-03-production
  • mbx-npm-02-production
  • mbx-npm-01-production
  • mbx-npm-02-staging
  • mapbox-npm-01
  • mapbox-npm-02
  • mapbox-npm-07
  • mapbox-npm-03
  • mapbox-npm-04
  • mapbox-npm-09
  • mapbox-npm-05
  • mapbox-npm-06
  • mapbox-npm-08
  • mapbox-npm-advanced-actions
  • mapbox-npm-ci
  • mapbox-npm
  • mapbox-admin
  • mapbox-machine-user