Skip to content

Instantly share code, notes, and snippets.

@seaside98
Last active August 29, 2015 14:00
Show Gist options
  • Save seaside98/11023204 to your computer and use it in GitHub Desktop.
Save seaside98/11023204 to your computer and use it in GitHub Desktop.
Creates random mediawiki pages
var num = prompt("Number of pages to create", "1");
var text = prompt("Page text", "Spam");
num = parseInt(num);
for (var i = 0; i < num; i++) {
var title = Math.random().toString(36).substring(13);
$.ajax({
url: wgServer + '/api.php?action=edit&title='+title+'&appendtext='+encodeURIComponent( text )+'&token='+encodeURIComponent( mw.user.tokens.get('editToken') ),
type: 'POST'
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment