Extension:AddPageService
From MediaWiki.org
|
AddPageService Release status: stable |
|
|---|---|
| Implementation | User rights, Page action |
| Description | Web service to add pages to the wiki. |
| Author(s) | Fernando Correia (Fernando.correiatalk) |
| Last version | 1.0.1 (2007-01-31) |
| MediaWiki | 1.8.2, 1.9.1 |
| License | No license specified |
| Download | AddPageService.php |
| Check usage and version matrix | |
Contents |
Introduction [edit]
AddPageService is a web service that enables external programs to add or edit pages on the wiki just as a regular user.
Features [edit]
- 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.
Installation [edit]
- 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.
Configuration [edit]
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).
Test [edit]
- 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:
http://server/wiki/extensions/TestAddPage.php
- 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.
Usage [edit]
Information about using the web service in external programs:
- The web service URL will be similar to this:
http://server/wiki/extensions/AddPageService.php
- The WSDL can be obtained by adding "?wsdl" to the URL, like this:
http://server/wiki/extensions/AddPageService.php?wsdl
- 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.
Credits [edit]
Partially based on Bulk Page Creator.
Alternatives [edit]
Feedback [edit]
Use the discussion page for feedback, questions, feature requests and bug reports.
