Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Add Node 12, fix cache, discontinue Node 8 #159

Merged
merged 3 commits into from
Apr 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"extends": "wikimedia",
"env": {
"node": true,
"es6": true
},
"extends": [
"wikimedia",
"wikimedia/node",
"wikimedia/language/es2016"
],
"rules": {
"prefer-const": "off",
"no-console": "off"
}
}
9 changes: 2 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
language: node_js
sudo: false
node_js:
- 12
- 10
- 8
- 6
script: "npm test && npm run-script lint"
cache:
directories:
- node_modules
cache: npm
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
nodemw
======

[MediaWiki API](http://www.mediawiki.org/wiki/API:Main_page) client written in node.js
[MediaWiki API](https://www.mediawiki.org/wiki/API:Main_page) client written in node.js

[![NPM version](https://badge.fury.io/js/nodemw.png)](http://badge.fury.io/js/nodemw)
[![Build Status](https://api.travis-ci.org/macbre/nodemw.svg?branch=devel)](http://travis-ci.org/macbre/nodemw)
[![NPM version](https://badge.fury.io/js/nodemw.svg)](https://www.npmjs.com/package/nodemw)
[![Build Status](https://api.travis-ci.org/macbre/nodemw.svg?branch=devel)](https://travis-ci.org/macbre/nodemw)

[![Download stats](https://nodei.co/npm/nodemw.png?downloads=true&downloadRank=true)](https://nodei.co/npm/nodemw/)

Expand Down
8 changes: 6 additions & 2 deletions examples/getToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ const Bot = require( '..' ),
} );

wikia.getToken( 'Main_page', 'edit', function ( err, token ) {
if ( err ) { wikia.log( err ); }
if ( err ) {
wikia.log( err );
}
wikia.log( 'Wikia:', token );
} );

wikipedia.getToken( 'Main_page', 'edit', function ( err, token ) {
if ( err ) { wikipedia.log( err ); }
if ( err ) {
wikipedia.log( err );
}
wikipedia.log( 'Wikipedia:', token );
} );
4 changes: 3 additions & 1 deletion examples/meaninglessNamedImages.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ client.logIn( function () {
} );
let i = 0;
imagesToDo.forEach( function ( item ) {
setTimeout( function () { rename( item ); }, 10000 * i );
setTimeout( function () {
rename( item );
}, 10000 * i );
i++;
} );
console.log( `do przerobienia: ${i}` );
Expand Down
16 changes: 12 additions & 4 deletions examples/purge.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,34 @@ const Bot = require( '..' ),
} );

client.purge( [ 'Pomnik_Bamberki', 'Ratusz' ], function ( err, data ) {
if ( err ) { client.log( err ); }
if ( err ) {
client.log( err );
}
console.log( data );
} );

// purge all articles in a given category (note a "Category:" prefix)
client.purge( 'Category:Ratusz', function ( err, data ) {
if ( err ) { client.log( err ); }
if ( err ) {
client.log( err );
}
console.log( data );
} );

// purge all articles in a given category the old way (before MW 1.21)
client.getPagesInCategory( 'Ratusz', function ( err, pages ) {
if ( err ) { return; }
if ( err ) {
return;
}

const pageIds = pages
.filter( ( page ) => page.ns === 0 )
.map( ( page ) => page.pageid );

client.purge( pageIds, function ( err, data ) {
if ( err ) { client.log( err ); }
if ( err ) {
client.log( err );
}
console.log( data );
} );
} );
4 changes: 3 additions & 1 deletion examples/specialLog2csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ async.whilst(
} );
},
function ( err ) {
if ( err ) { throw err; }
if ( err ) {
throw err;
}

client.log( 'Done' );
}
Expand Down
2 changes: 1 addition & 1 deletion examples/wikidata.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class WikiData {
}
}

const data = new WikiData(); // eslint-disable-line one-var
const data = new WikiData();

data.getEntities(
[
Expand Down