User:ChzzBot II/doc

Premise
Maintain the heading on sandboxes, and clear them periodically.

Sandboxes checked
(more TBA)

ChzzBot II program "Sandbox one"
Runs continuously. Checks whether the header exists, if not, prepend one.

Details
Every 1 minute (which could be adjusted), it checks the following sandboxes, to see if they start with either or any of the following redirects to that;


 * Template:Please leave this line alone (sandbox talk heading)
 * Template:Please leave this line alone (Sandbox heading)
 * Template:Sandbox heading/noedit
 * Template:Please leave this line alone (sandbox talk heading)/noedit


 * Template:PLTLA (SH)
 * Template:Please leave this line alone (sandbox heading)
 * Template:Please leave this line alone (sandbox heading)/noedit


 * If the page starts with any of those, it does nothing.


 * If they do not, it inserts (and two line breaks).


 * It also checks for the existence of any of the templates elsewhere in the page (if the heading had just been moved down), and if it finds any (heading), it removes it.

Note: It does not reinsert the heading more than once every 5 minutes (configurable) - to avoid any possible 'warring'.

ChzzBot II program "Sandbox two"
Runs once per hour. Clears the sandboxes (replacing the content with the header).

Details
An hourly run is scheduled via CRON - so, if it fails, it should re-try in an hour.

If the sandbox has not been edited by anyone other than ChzzBot II, it replaces the entire sandbox page with this (which could be tweaked)...

 <!--
 * Welcome to the sandbox!             *
 * Please leave this part alone           *
 * The page is cleared regularly           *
 * Feel free to try your editing skills below    *

If the page has been edited in the past (3) minutes, it waits for a few (3) minutes and re-checks. It does that (3) times, after which, it clears the sandbox regardless.
 * The above specific parameters may be tweaked

Discussion / ideas

 * I've asked for the Template: Sandbox heading to be modified to be more 'generic', so the same template makes sense on the other sandboxes.
 * Possible enhancements;
 * tuning any problematic templates
 * Adding possible 'example' - when clearing the sandbox, it seems to help if the bot writes 'hello world' or whatever under the heading - as an 'example' that users can actually edit. It might be good to add something like "I like Sausages" or whatever, to show a link. Possibly, it could be one of a random sample of texts.
 * Clearing the talk pages of all of 'em. I'll try to work on that, as time permits (might be slight consideration re. heading; not sure)
 * More 'sandbox' pages could be swept. Need to look for those. I know there's an AFC one. Again...something I will work on, as time permits.


 * Code release, better documentation, and set-up as a multi-maintainer project - so that others can make sure this thing works, forever. I'll try to make that happen.
 * I may code the bot to notify me on my talk page, what it has been up to - that could also alert me if e.g. it's been clearing very often, or whatever - easier for me to check on problems.
 * Is hourly clearing OK? It can easily be adjusted - and could be changed 'per sandbox' if we thought appropriate