wikipedia_api_block (line 487)
Blocks a wiki user
Blocks/unblocks a wiki user. Requires a (un)block token from wikipedia_api_blocktoken
wpapierrclass
wikipedia_api_block
(
wpapicurl $wac,
string $token,
string $user, [
string $reason =
""], [
string $expiry =
"never"], [
Array $addoptions =
array()])
-
wpapicurl
$wac: WikipediaAPI object
-
string
$token: Block token
-
string
$user: The user to block
-
string
$reason: Reason for (un)blocking user
-
string
$expiry: Expiry timestamp
-
Array
$addoptions: Additional options, including: anononly: Block only anonymous edits nocreate: Block account creation from user's IP autoblock: Automatically block any IP addresses used by this user, past and future noemail: Block e-mail
wikipedia_api_blocktoken (line 458)
Gets a block/unblock token required to (un)block a user in wikipedia_api_block
string
wikipedia_api_blocktoken
(
wpapicurl $wac,
string $user, [
bool $block =
true])
-
wpapicurl
$wac: A WikipediaAPI object
-
string
$user: The user to be (un)blocked (E.g. for User:Example $user would be "Example"
-
bool
$block: True to block, false to unblock
wikipedia_api_checklogin (line 190)
Checks to see if we are logged in
bool
wikipedia_api_checklogin
(
wpapicurl $wac)
wikipedia_api_converterr (line 144)
Coverts MediaWiki errors to wpapierrclass errors - not to be used directly.
int
wikipedia_api_converterr
(string $error)
-
string
$error: MediaWiki error
wikipedia_api_delete (line 380)
Deletes a wiki page
Deletes a wiki page. Requires a delete token from wikipedia_api_deletetoken
wpapierrclass
wikipedia_api_delete
(
wpapicurl $wac,
string $token,
string $title, [
string $reason =
""])
-
wpapicurl
$wac: WikipediaAPI object
-
string
$token: Delete token
-
string
$title: The page to delete
-
string
$reason: Reason for deleting page
wikipedia_api_deletetoken (line 362)
Gets a delete token required to move the page in wikipedia_api_delete
string
wikipedia_api_deletetoken
(
wpapicurl $wac, [
string $title =
"Sandbox"])
-
wpapicurl
$wac: A WikipediaAPI object
-
string
$title: The page to be deleted
wikipedia_api_edit (line 333)
Edits a wiki page
Edits a wiki page. Requires an edit token, which can be obtained with wikipedia_api_edittoken.
wpapierrclass
wikipedia_api_edit
(
wpapicurl $wac,
string $token,
string $t,
string $c, [
string $summary =
""], [
bool $minor =
false])
-
wpapicurl
$wac: WikipediaAPI object
-
string
$token: Edit token (obtained at wikipedia_api_edittoken
-
string
$t: The page to edit
-
string
$c: New page contents
-
string
$summary: Edit summary
-
bool
$minor: If true, sets as minor edit
wikipedia_api_editcount (line 269)
Get the edit count for the current user
Gets the edit count for the currently logged in user. If you did not log in yet, it returns zero.
wikipedia_api_edittoken (line 312)
Gets an edit token required to edit the page in wikipedia_api_edit
string
wikipedia_api_edittoken
(
wpapicurl $wac, [
string $title =
"Main Page"])
-
wpapicurl
$wac: A WikipediaAPI object
-
string
$title: The page to be edited
wikipedia_api_getpage (line 284)
Gets the contents of a page
string
wikipedia_api_getpage
(
wpapicurl $wac,
string $title)
-
wpapicurl
$wac: A WikipediaAPI object
-
string
$title: Title of the page
wikipedia_api_getpagecreator (line 298)
Get page creator
string
wikipedia_api_getpagecreator
(
wpapicurl $wac,
string $title)
-
wpapicurl
$wac: A WikipediaAPI object
-
string
$title: Title of the page
wikipedia_api_init (line 201)
Initalizes a WikipediaAPI object
wpapicurl
wikipedia_api_init
([
string $wiki =
WIKIPEDIA])
-
string
$wiki: An URL to the api.php of the wiki to use (defaults to English Wikipedia)
wikipedia_api_login (line 214)
Login to the wiki
-
wpapicurl
$wac: A WikipediaAPI object
-
string
$user: The username
-
string
$pass: The password
wikipedia_api_logout (line 253)
Log out of the wiki
wikipedia_api_move (line 424)
Moves a wiki page
Moves a wiki page. Requires a move token from wikipedia_api_movetoken
wpapierrclass
wikipedia_api_move
(
wpapicurl $wac,
string $token,
string $from,
string $to, [
string $reason =
"moving page"])
-
wpapicurl
$wac: WikipediaAPI object
-
string
$token: Move token
-
string
$from: The page to move
-
string
$to: Destination
-
string
$reason: Reason for moving page
wikipedia_api_movetoken (line 404)
Gets an move token required to move the page in wikipedia_api_move
string
wikipedia_api_movetoken
(
wpapicurl $wac, [
string $title =
"Main Page"])
-
wpapicurl
$wac: A WikipediaAPI object
-
string
$title: The page to be moved
wikipedia_api_recentchanges (line 439)
Get the list of recent changes
Array
wikipedia_api_recentchanges
(
wpapicurl $wac, [
int $limit =
1])
-
int
$limit: How many recent changes to display
-
wpapicurl
$wac: WikipediaAPI object