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.
var api = new mw.Api();
var token = mw.user.tokens.values.csrfToken;
api.get({
action: 'query',
list: 'categorymembers',
cmtitle: 'Категорія:Списки астероїдів',
cmnamespace: 0,
cmlimit: 'max'
}).done(function(data) {
$.each(data.query.categorymembers, function() {
var page = this;
var title = page.title.replace(/(\d+)[-–—](\d+)/, "$1—$2")
console.log([page.title, title]);
api.post({
action: 'move',
from: page.title,
to: title,
movetalk: 1,
reason: "Бот: тире замість дефісу за [[Special:Permalink/36936257#Дефіс_на_тире_у_списках_астероїдів|запитом]]",
token: token
}).done(function(data){
console.log(page.title + ' must have been moved');
})
})
});