Socket
Socket
Sign inDemoInstall

random-wiki-batch

Package Overview
Dependencies
21
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    random-wiki-batch

Get a random batch of wikipedia articles using the MediaWiki API


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

random-wiki-batch

Get a specified number of random Wikipedia articles. Returns a Promise consisting of an array of random articles from Wikipedia using the MediaWiki API with their titles, pageid, and content.

The content appears under the revisions key of an article as raw wikitext. Check out txtwiki.js for parsing wikitext as plaintext.

Install

$ npm install --save random-wiki-batch

Usage

const randomWikiBatch = require('random-wiki-batch');

// If no arguments passed, randomWikiBatch defaults to 10 random articles
const randomArticles = randomWikiBatch(3);

randomArticles.then(articles => console.log(articles));
// [ { pageid: 1442049,
//     ns: 0,
//     title: 'International Center of Photography',
//     revisions: [ [Object] ] },
//   { pageid: 51440676,
//     ns: 0,
//     title: 'Basti Azeem',
//     revisions: [ [Object] ] },
//   { pageid: 53745028,
//     ns: 0,
//     title: 'Gold Star Families Memorial and Park',
//     revisions: [ [Object] ] } ]

License

MIT

Keywords

FAQs

Last updated on 08 Jun 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