1.1.6 • Published 6 years ago
wikiparser v1.1.6
Wikipedia Parser
Simple and best tool to parse wikipedia
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
License
This project is licensed under the Apache License 2.0 - see the LICENSE.md file for details