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.
const api = new mw.Api();
const reason = 'Renaming translations with incorrect language code';
const namespace = 1198;
const user = 'Aamrs';
const startDate = '2019-01-06T18:00:00.000Z';
const wrongLanguage = 'en-gb';
const correctLanguage = 'pt';
api.get({
action: 'query',
meta: 'tokens'
}).done((data) => {
console.log(data);
const token = data.query.tokens.csrftoken;
api.get({
action: 'query',
list: 'usercontribs',
ucuser: user,
ucstart: startDate,
ucnamespace: namespace,
ucdir: 'newer',
uclimit: 'max'
}).done((data) => {
data.query.usercontribs.forEach(item => {
api.post({
action: 'edit',
pageid: item.pageid,
summary: 'Zero edit',
appendtext: '',
token: token
}).done(function(data){
console.log(item.title + ' must have been zero-edited');
})
});
});
});