PHP code example of hamstar / wikimate
1. Go to this page and download the library: Download hamstar/wikimate library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hamstar / wikimate example snippets
$api_url = 'https://example.com/w/api.php';
$username = 'bot';
$password = 'password';
$wiki = new Wikimate($api_url);
// You can also pass the domain name:
// $wiki->login($username, $password, $domainName)
if ($wiki->login($username, $password))
echo 'Success: user logged in.' ;
else {
$error = $wiki->getError();
echo "<b>Wikimate error</b>: ".$error['auth'];
}