Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
let api = new mw.Api();
api.get({
action: 'query',
meta: 'tokens'
}).done(function(data) {
console.log(data);
let token = data.query.tokens.csrftoken;
api.get({
action: 'query',
list: 'categorymembers',
cmtitle: mw.config.get('wgPageName'),
cmlimit: 'max'
}).done(function(data) {
$.each(data.query.categorymembers, function() {
let page = this;
api.post({
action: 'edit',
pageid: page.pageid,
summary: 'Zero edit',
appendtext: '',
token: token
}).done(function(data){
console.log(page.title + ' must have been zero-edited');
})
})
});
});