Table:The bot

Discussion
It's not so much a discussion as news, but I am currently working on turning the bot into a routine job, that will initially run every 3 hours. It currently only performs the task of cleaning up the category links in articles from the top to bottom or arranging them alphabetically. It will, of course, eventually, do many more tasks to articles.

Algorithm

Here is the basis algorithm of the bot:


 * 1) Check if the botlock file exists; if it does, don't do anything, it could mean the last run broke or something.
 * 2) * A possible future feature here could be to email me when this happens so I can check out if there is a problem.
 * 3) Initiate data
 * 4) Create a botlock file.  Should the script fail at any point, this file will remain as evidence of failure.
 * 5) Obtain the previous timestamp of when the script run, as to only get the recent changes since then.
 * 6) * If timestamp is not available check the previous 10 changes
 * 7) * Or if it is available, but no new changes have been made, check 5 random articles
 * 8) Run through the pages obtained
 * 9) Arrange their categories
 * 10) Nothing else right now
 * 11) If there is a change to its content, commit the edit
 * 12) If another pages, repeat these steps
 * 13) Finishing off
 * 14) Creating a new timestamp
 * 15) Removing the botlock
 * 16) Write the log (each step applies a comment to the log, which is written at this point)
 * 17) Done.

Suggestions for future features are of course most welcome. Current ideas include changing and  to  and  respectively and something about making sure episode inline episode links (which does not make use of a template) are correct, e.g. quotations around episode titles and film titles in italic, etc. --Sviptalk 21:52, 5 April 2010 (CEST)
 * Maybe something to fix quotes? That will be a bit more complicated, but I am sure could be automatic. --Sviptalk 21:57, 5 April 2010 (CEST)
 * Everything seems okay so far. Can't think of anything else to sick the bot on. - Quolnok 12:07, 6 April 2010 (CEST)