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 = 'Непристойний вміст';
const user = 'З Новим Роком 2024';
api.get({
action: 'query',
meta: 'tokens'
}).done((data) => {
console.log(data);
const token = data.query.tokens.csrftoken;
//list=usercontribs&formatversion=2&uclimit=max&ucuser=%D0%97%20%D0%9D%D0%BE%D0%B2%D0%B8%D0%BC%20%D0%A0%D0%BE%D0%BA%D0%BE%D0%BC%202024&ucprop=ids
api.get({
action: 'query',
list: 'usercontribs',
ucuser: user,
uclimit: 'max',
ucprop: 'ids'
}).done((data) => {
data.query.usercontribs.forEach(item => {
api.post({
action: 'revisiondelete',
type: 'revision',
ids: item.revid,
hide: ['content', 'comment'],
reason: reason,
token: token
}).done(function(data){
console.log(item.revid + ' must has been revdeleted');
});
});
});
});