Manual:Chris G's botclasses

Jump to: navigation, search

Chris G's botclasses compose a PHP MediaWiki bot framework hosted at the toolserver. They are derived from the wikibot.classes used by ClueBot. To use this framework, it is necessary to download botclasses.php and all its dependencies (viz. http.php, lyricswiki.php, and mediawiki.php) from Or use git clone



 * HelloWorldBot.php
 * This bot edits Wikipedia:Sandbox.

/* Setup my classes. */
include( 'botclasses.php' );
$wiki      = new wikipedia;
$wiki->url = "";
$wiki->setUserAgent( 'User-Agent: FooBot (' );
/* All the login stuff. */
$user = 'REMOVED';
$pass = 'REMOVED';
$wiki->login( $user, $pass );
/* Test edit. */
$page = 'Wikipedia:Sandbox';
$content = 'Hello, world!';
$summary = 'This is a sample bot edit.';
$wiki->edit( $page, $content, $summary );

Other bots[edit]