$url
$url :
This class is interacts with the Wiki using api.php.
query( $query, $post = null, $repeat = null, $url = null) : mixed
Sends a query to the API.
| $query | The query string. |
|
| $post | POST data if its a post request (optional). |
|
| $repeat | How many times the request will be repeated. |
|
| $url | The URL where we want to work (for external services API). |
The response from server (API result).
getpage( $page, $revid = null, $detectEditConflict = false) : string
Gets the content of a page. Returns false on error.
Use getPageContents() as alternative to get the page in multiple formats
| $page | The wikipedia page to fetch. |
|
| $revid | The revision id to fetch (optional). |
|
| $detectEditConflict |
The wikitext for the given page.
categorymembers( $category, $limit = 10, $continue = null, $subcat = false) : array
Returns an array with all the members of $category
| $category | The category to use. |
|
| $limit | The maximum members returned (10 by default) |
|
| $continue | The parameters to continue previous query |
|
| $subcat | (bool) Go into sub categories? |
The category ID.
nobots( $page, $user = null, $text = null) : boolean
Check if we're allowed to edit $page.
See http://en.wikipedia.org/wiki/Template:Bots for more info.
| $page | The page we want to edit. |
|
| $user | The bot's username. |
|
| $text |
edit( $page, $data, $summary = '', $minor = false, $bot = true, $section = null, $detectEC = false, $maxlag = '') : array
Edits a page.
| $page | Page name to edit. |
|
| $data | Data to post to page. |
|
| $summary | Edit summary to use. |
|
| $minor | Whether or not to mark edit as minor. (Default false) |
|
| $bot | Whether or not to mark edit as a bot edit. (Default true) |
|
| $section | ||
| $detectEC | ||
| $maxlag |
The API result
getfilelocation( $page) : string
BMcN 2012-09-16 Retrieve a media file's actual location.
| $page | The "File:" page on the wiki which the URL of is desired. |
The URL pointing directly to the media file (Eg http://upload.mediawiki.org/wikipedia/en/1/1/Example.jpg)
replacestring( $page, $string, $newstring, $regex = false) : string
Replace a string
| $page | The page we're working with. |
|
| $string | The string that you want to replace. (it can be a string or an array |
|
| $newstring | The string that will replace the present string. (same as above) |
|
| $regex | If $string will be considered as a regular expression |
The new text of page