New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

wiki-page

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wiki-page

A lightweight module used for fetching content and data from Wikipedia using the Wikipedia REST API

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-90.91%
Maintainers
1
Weekly downloads
 
Created
Source

Wiki-Page

A straightforward and lightweight Node.js module for accessing Wikimedia content using the Wikipedia REST API

Install using the node.js package manager npm:

$ npm install wiki-page

Examples:

Usage

Require Module and Initialize Client

var wiki = require('wiki-page');

Wiki fetch - EXAMPLES

wiki.get({params}, callback)

wiki.fetch({
    section: 'page',
    type: 'summary',
    title: 'orlando fl',
    }, (data) => {
    console.log(data);
});

params {Object} Documentation - Please see the Wikipedia REST API for full list of endpoints

  • section: The section type in the Wikipedia REST API - 'page', 'data', 'feed', 'transform', etc.
  • type: The content type - 'pdf', 'title', 'summary', 'html', 'media', 'metadata', 'references', 'mobile-html', 'related', 'random', 'pdf', 'data-parsoid', 'lint', 'onthisday', 'segments'
  • title: The subject of the returned content - 'calico cat', 'german shepard' or 'ford falcon'
  • event: For use in endpoints that require and event type - 'births', 'all', 'selected', 'deaths', 'events', 'holidays'
  • revision: For use in endpoints that require a revision number - '3606853'
  • date: For use in endpoints that require a date - '06/11' or '2012/05/12'
  • format: For use in endpoints that require a format - 'title', 'html', 'summary', 'related', 'mobile-sections', 'mobile-sections-lead'

Alternatively you can use the complete endpoint provided in the Wikipedia REST API - EXAMPLES

wiki.fetch({endpoint}, callback)

wiki.fetch({query: '/page/summary/orlando'}, (data) => {
    console.log(data);
});

Testing

Clone the repo and run the test.js file using $ node test

$ git clone git://github.com/waltir/wiki-page.git
$ cd wiki-page
$ npm install
$ node test

Keywords

FAQs

Package last updated on 11 May 2019

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