User:TheRave/Projects/waveBot/Documentation

From Guild Wars Wiki
Jump to navigationJump to search
General   Characters   Tools   Projects   Talk    
waveBot Documentation edit

Idea[edit]

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[edit]

  • 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.

Design[edit]

Process[edit]

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.
    1. Updates last queried timestamp to newest timestamp on list
    2. 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
    3. Queries selected pages for content
    4. Scans content for unsigned comments
    5. Edits pages requiring the unsigned template
    6. Adds user who didn't sign to internal warning counter
  4. Repeats recent changes query until last queried timestamp equals current time minus 3 minute grace period
  5. Edits user's talk page who have a warning counter of 2
  6. Repeats every 15minutes

Queries[edit]

List of useful queries that have been constructed.

Implementation[edit]

SxWiki[edit]

SxWiki is a simple free class built for querying the MediaWiki API.