User:Hat600/script/massdelete.js
外观
注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的更改的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5。
;(function($){
while(1){
var title = $('#tem').children('ul').children('li:eq(0)')
.children('a').attr('title');
if(title === undefined) return 0;
alert(title);
var token = '';
$.ajax({
url: 'https://zh.wikisource.org/w/api.php?format=json&action=query&meta=tokens',
type: 'GET',
dataType: 'json',
success: function(json){
token = json.query.tokens.csrftoken;
$.ajax({
url: 'https://zh.wikisource.org/w/api.php',
type: 'POST',
data: {
action: 'delete',
title: title,
reason: 'per req, see [[WS:DEL]]',
token: token,
format: 'json'
},
dataType: 'json',
success: function(json){
console.log('success');
}
});
}
});
$('#tem').children('ul').children('li:eq(0)').remove();
}
})(jQuery);