User:TheRave/Projects/waveBot/Documentation

Idea
waveBot is a bot that is designed to add unsigned tags to unsigned edits made to talk pages as well as non-talk discussion pages. The bot derives its name from the method of signing comments on MediaWiki, which involves typing four tildes in a row ( ~ ). Each tilde looks like a small wave.

Specification

 * Written in PHP.
 * Uses the MediaWiki api.php.
 * Monitors all talk pages.
 * Monitors non-talk pages that are specifically for discussion.
 * Automatically adds the unsigned tag to comments left by both registered and anonymous users.
 * Allows users a grace period before assuming the user forgot to sign.
 * Ignores talk pages that have specifically opted-out.
 * Ignores comments left by users who have specifically opted-out.

Process
The step by step process required.
 * 1) Queries pages linking to the opt in template and updates the opted in internal page list
 * 2) Queries pages linking to the opt out template and updates the opted out internal page and user list
 * 3) Queries recent changes from last queried timestamp until current time minus 3 minute grace period, retrieving only edits/new pages (not log items, e.g. uploads/blocks/etc) ordered from oldest to newest, retrieving namespace, title, user, comments and timestamp only up to 100 items.
 * 4) Updates last queried timestamp to newest timestamp on list
 * 5) Selects pages within talk namespaces (1,3,5,7,9,11,13,15,101,103,201) or from other namespaces with titles that are on the opted in list, ignoring pages that with titles that are on the opted out list title/user
 * 6) Queries selected pages for content
 * 7) Scans content for unsigned comments
 * 8) Edits pages requiring the unsigned template
 * 9) Adds user who didn't sign to internal warning counter
 * 10) Repeats recent changes query until last queried timestamp equals current time minus 3 minute grace period
 * 11) Edits user's talk page who have a warning counter of 2
 * 12) Repeats every 15minutes

Queries
List of useful queries that have been constructed.
 * Enumeration
 * |new&rcprop=title|timestamp|comment|user&rclimit=100 100 recent changes (new/edit) since 2008-09-30 08:32:19 showing namespace, title, timestamp and comment

SxWiki
SxWiki is a simple free class built for querying the MediaWiki API.
 * Details
 * Source Code