0.0.0 • Published 7 years ago
wikimedia-page-views v0.0.0
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.
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.
0.0.0
7 years ago