Home

Awesome

WikiInfobox by @michalbe

Simple Wikipedia infobox scraper.

What?

WikiInfobox is a simple Wikipedia infobox scraper. What is infobox? According to Wikipedia itself, an infobox template is a panel, usually in the top right of an article, next to the lead section, (in the desktop view) or at the very top of an article (in mobile view), that summarizes key features of the page's subject. Infoboxes may also include an image, and/ or a map.

Infobox

Why?

How to use:

npm install wiki-infobox

then:

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

var page = 'Warsaw Metro';
var language = 'en';

infobox(page, language, function(err, data){
  if (err) {
    // Oh no! Something goes wrong!
    return;
  }

  console.log(data);
  // {
  //   box_length: '275px',
  //   name:
  //     {
  //       type: 'text',
  //       value: 'Warsaw Metro<br>\'\'Metro Warszawskie\'\''
  //     },
  //   owner:
  //    {
  //      type: 'text',
  //      value: 'City of Warsaw'
  //    },
  //   locale:
  //    [ { type: 'link',
  //        text: 'Warsaw',
  //        url: 'http://en.wikipedia.org/wiki/Warsaw' },
  //      { type: 'link',
  //        text: 'Poland',
  //        url: 'http://en.wikipedia.org/wiki/Poland' } ],
  //   transit_type:
  //    { type: 'link',
  //      text: 'Rapid transit',
  //      url: 'http://en.wikipedia.org/wiki/Rapid transit' },
  //   lines: '1<ref name',
  //   stations: '21<ref name',
  //   ridership: '568,000 <small>(2012; ave. weekday)</small><ref name',
  //   annual_ridership: '139.17 million <small>(2012)</small><ref name',
  //   website: '{{url|www.metro.waw.pl|Metro Warszawskie}}',
  //   began_operation: '1995',
  //   operator: 'Metro Warszawskie',
  //   marks: '',
  //   vehicles: '',
  //   system_length: '{{convert|22.7|km|mi|1|abbr',
  //   track_gauge:
  //    { type: 'link',
  //      text: 'standard gauge',
  //      url: 'http://en.wikipedia.org/wiki/standard gauge' },
  //   map:
  //    { type: 'image',
  //      text: 'frameless',
  //      url: 'http://en.wikipedia.org/wiki/File:Metro w Warszawie 1 linia.svg' },
  //   map_name: '',
  //   map_state: '}}'
  // }
});

What's new?

To Do

Support of:

Contributing

Interested in contributing to wiki-infobox? Read this first