|This extension stores its source code on a wiki page. Please be aware that this code may be unreviewed or maliciously altered. They may contain security holes, outdated interfaces that are no longer compatible etc.|
request access to MediaWiki's code repository to address this.
Release status: stable
|Implementation||User rights, Page action|
|Description||Web service to add pages to the wiki.|
|Author(s)||Fernando Correia (Fernando.correiatalk)|
|Latest version||1.0.1 (2007-01-31)|
|License||No license specified|
Translate the AddPageService extension if it is available at translatewiki.net
|Check usage and version matrix.|
AddPageService is a web service that enables external programs to add or edit pages on the wiki just as a regular user.
- Can add or edit pages.
- Impersonates a wiki user.
- Requires user name and password.
- Has the same behavior as a manual edit.
- Silently replaces invalid characters in page titles.
- Install Snoopy. Download it and extract it into some directory.
- Install PEAR SOAP. For instance, execute this command in the php directory:
pear install channel://pear.php.net/soap-0.10.1
- Download AddPageService.php and save it in the extensions directory of your wiki.
Edit the "Customization required" section in AddPageService.php:
- $wiki_root_url: Must point to the base URL of your wiki.
- Snoopy: Specify the correct path for the include directive for the Snoopy class.
- $debug_file_name: Specify a full pathname for a temporary debug file or an empty string to disable this feature.
- The debug file shows the wiki response to the request to open the edit form. Most problems can be diagnosed with the error messages in this file.
- $strict_title_rules: True to apply more strict rules about valid characters in page titles.
- With this option on, some characters that are valid but may cause problems will be substituted for spaces. For more information see Wikipedia:Naming conventions (technical restrictions).
- Download TestAddPage.php and save it in the extensions directory of your wiki.
- Edit the "Customization required" section in TestAddPage.php:
- $endpoint: The full URL of the AddPage web service.
- $user: A valid wiki user name.
- $password: The password of the $user.
- $title: The title of the test page to be created.
- $text: The contents of the test page to be created.
- Using the full URL, open TestAddPage.php in your browser. For instance:
- The web service answer will be shown. It will be "OK" or an error message.
- Verify that the test page shows on the "Recent changes" page on the wiki.
Information about using the web service in external programs:
- The web service URL will be similar to this:
- The WSDL can be obtained by adding "?wsdl" to the URL, like this:
- The web service method to be called is named addPage.
- It has these parameters:
- title: page title (UTF-8 encoded).
- text: page text (UTF-8 encoded).
- user: wiki user name.
- password: wiki user password.
- Use a high timeout. For instance, 30 seconds. The web service opens several web forms and may take a few seconds to answer.
- Verify that the method returns "OK". Otherwise, show the returned error message.
Partially based on Bulk Page Creator.
Release date: 2007-01-31
- Removes restricted characters from page titles.
- Outputs debug file.
Release date: 2007-01-31
- Initial release.
Use the discussion page for feedback, questions, feature requests and bug reports.