Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

random-wiki-batch

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

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

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 08 Jun 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc