Manual:Chris G's botclasses

Chris G's botclasses is a PHP MediaWiki bot framework (formerly?) hosted at the toolserver. They are derived from the wikibot.classes used by ClueBot. See also wikipedia:User:RMCD_bot/botclasses.php and htt ps://github.com/legoktm/harej-bots/blob/master/botclasses.php

BotsEdit

HelloWorldBot.phpEdit

<?php
/*
 * HelloWorldBot.php
 * This bot edits Wikipedia:Sandbox.
/*

/* Setup my classes. */
include( 'botclasses.php' );
$wiki      = new wikipedia;
$wiki->url = "https://en.wikipedia.org/w/api.php";
$wiki->setUserAgent( 'User-Agent: FooBot (https://mediawiki.org/wiki/User: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 botsEdit