Socket
Socket
Sign inDemoInstall

wikidata-changes-stream

Package Overview
Dependencies
52
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

wikidata-changes-stream

Represent wikidata changes API as a node stream


Version published
Maintainers
1
0
Bundle size
229.3 kB
Minified + gzipped

Weekly downloads

Readme

Source

wikidata-changes-stream

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

  • https://www.wikidata.org/w/api.php?action=query&list=recentchanges
  • https://www.mediawiki.org/wiki/API:RecentChanges

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

Keywords

FAQs

Last updated on 07 Nov 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc