wikiparser

1.1.6 • Public • Published

Wikipedia Parser                                          wikiparser logo

Simple and best tool to parse wikipedia

NPM

Build Status

npm install wikiparser

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Installing

A step by step series of examples that tell you have to get a development env running

Install latest node and npm

https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

Dependency

  • Python
  • wikiparser

Require

var wiki = require('wikiparser');

Methods

  • infoBox()
// To get info_box table from wikipedia as json
wiki.infoBox("https://en.wikipedia.org/wiki/Methane", function(err, res) {
    if (err) throw err;
    
    if (res) {
        // do something with json
        console.log(res);
    }
});
  • getParagraph()
//To get Paragraph from wikipedia as json
wiki.getParagraph("https://en.wikipedia.org/wiki/Methane", function(err, res) {
      if (err) throw err;
      
      if (res) {
          // do something with json
          console.log(res.data);
      }
});
  • getMainImage()
//To get main image from wikipedia
wiki.getMainImage("https://en.wikipedia.org/wiki/Methane", function(err, res) {
    if (err) throw err;
    
    if (res) {
        // do something with image
        console.log(res);
    }
});

Example

var wiki = require('wikiparser');
 
wiki.getMainImage("https://en.wikipedia.org/wiki/Methane", function(err, res) {
    if (err) throw err;
    
    if (res) {
        // do something with image
        console.log(res);
    }
});

Running the tests

Explain how to run the automated tests for this system

Built With

wikiparser 1.0.1 python package (KiKe)

Authors

KiKe

License

This project is licensed under the Apache License 2.0 - see the LICENSE.md file for details

Package Sidebar

Install

npm i wikiparser

Weekly Downloads

15

Version

1.1.6

License

Apache-2.0

Last publish

Collaborators

  • keerthiniranjan
  • kiranniranjan