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) Run through its tasks
 * 10) Arrange their categories
 * 11) Fix their quotes
 * 12) Nothing else right now
 * 13) If there is a change to its content, commit the edit
 * 14) If another pages, repeat these steps
 * 15) Finishing off
 * 16) Creating a new timestamp
 * 17) Removing the botlock
 * 18) Write the log (each step applies a comment to the log, which is written at this point)
 * 19) 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)

Updated the algorithm with a new feature, it now also attempts to fix quotes, see here. It will also conform existing quotes in this manner to our standard. --Sviptalk 17:32, 7 April 2010 (CEST)