Last active
August 29, 2015 14:00
-
-
Save seaside98/11023204 to your computer and use it in GitHub Desktop.
Creates random mediawiki pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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