This package has been deprecated

Author message:

WARNING: This package is unmaintained and might be broken.

wikimedia-page-views

0.0.0 • Public • Published

wikimedia-page-views

Fetch daily view count for given page on given wikimedia site for a defined date interval using this API. Work in progress.

npm version Build Status Greenkeeper badge dependency status dev dependency status license chat on gitter

Installation

npm install wikimedia-page-views

Usage

The module returns a Promise that will resolve in a list of views per day:

const views = require('wikimedia-page-views')

views(pageName, siteName, startDate, endDate)

Time of startDate and endDate will be ignored (due to limitations made by the original API), results will be displayed per-day in UTC time.

views('Leipzig', 'de.wikipedia', new Date('2017-12-01'), new Date('2017-12-10'))
.then(console.log)

would give you something like this:

[
    {
        "site": "de.wikipedia",
        "page": "Leipzig",
        "date": "2017-12-01T00:00:00.000Z",
        "views": 1920
    },
    {
        "site": "de.wikipedia",
        "page": "Leipzig",
        "date": "2017-12-02T00:00:00.000Z",
        "views": 2004
    },
    // …
    {
        "site": "de.wikipedia",
        "page": "Leipzig",
        "date": "2017-12-10T00:00:00.000Z",
        "views": 2090
    }
]

Contributing

If you found a bug, want to propose a feature or feel the urge to complain about your life, feel free to visit the issues page.

Package Sidebar

Install

npm i wikimedia-page-views

Weekly Downloads

0

Version

0.0.0

License

ISC

Last publish

Collaborators

  • juliuste