Manual:Chris G'nin bot sınıfları

From mediawiki.org
This page is a translated version of the page Manual:Chris G's botclasses and the translation is 100% complete.

Chris G'nin bot sınıfları, Toolserver adresinde barındırılan bir PHP MediaWiki bot çerçevesidir (eski adıyla?). ClueBot tarafından kullanılan wikibot.classes üzerinden türetilmiştir. Ayrıca w:User:RMCD bot/botclasses.php ve https://github.com/legoktm/harej-bots/blob/master/botclasses.php bakınız

Botlar

HelloWorldBot.php

<?php
/*
 * HelloWorldBot.php
 * Bu bot Wikipedia:Sandbox ile düzenler.
/*

/* Sınıflarımı kur. */
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)' );
 
/* Tüm oturum bilgileri. */
$user = 'REMOVED';
$pass = 'REMOVED';
$wiki->login( $user, $pass );
 
/* Test düzenleme. */
$page = 'Wikipedia:Sandbox';
$content = 'Hello, world!';
$summary = 'This is a sample bot edit.';
$wiki->edit( $page, $content, $summary );

Diğer botlar