Author: jhall
Description:
The Mediawiki API provides the ability to create new user accounts[1]
For example, the following two Curl commands issued in sequence will create a new user at a Mediawiki instance running on "localhost":
curl -c cookies.txt -X POST "http://localhost/mediawiki/api.php?action=createaccount&name=Tester&password=test1234&language=en&format=json&token="
curl -b cookies.txt -X POST "http://localhost/mediawiki/api.php?action=createaccount&name=Tester&password=test1234&language=en&format=json&token=<token provided in response to previous request>"
As a proof-of-concept, create a Python script that will do the same thing, with two special functions:
- The URL of the Mediawiki instance should be created from the value of an environment variable called "API_URL" (for example, using Python's "os.getenv" method).
- The account name and password should be randomly generated alphanumeric strings, each with a length of 8 characters.
[1] http://www.mediawiki.org/wiki/API:Account_creation
Version: wmf-deployment
Severity: enhancement
Whiteboard: gci2013 https://www.mediawiki.org/wiki/Google_Code-In#Candidate_tasks