Announcement

I've just perfected UnderBot, a program to add lang tags where they're missing and fix them where they're present. By fixing lang tags, I mean changing them to use the right identifier (e.g., "cfm" rather than "coldfusion") and getting rid of excessive whitespace. UnderBot isn't perfect, since it has to guess a great deal, but I've polished it to the point that I think unleashing it upon Rosetta Code would fix a lot more than it would break. Here are UnderBot's last six edits:

(Full disclosure: I did manually change a few characters in one of these edits. But it was one of those special cases that's so rare it's not worth implementing.)

So, I just want to ask permission of Rosetta Code in general, and Mike Mol in particular, to let this program edit 330 pages without supervision. I also want to ask what's a good number of seconds (or minutes, or hours) to pause between edits so as to avoid excessive strain on the server. Oh, and I request that dummy language files for ALGOL 68, APL, and TI-89 BASIC be installed into Rosetta Code's GeSHi (just make copies of text.php and name them algol68.php, apl.php, and ti89b.php), to guard against this bug.

Lastly, everyone: even if you don't know Perl or don't want to check the bulk of my code, glance at the %langtags hash in the source and see if you agree with the lang-tag identifiers I've chosen for the languages you know. —Underscore (Talk) 20:03, 14 November 2009 (UTC)

Can you put a kill switch in place? Such as if a string appears on a particular page? Then give it an edit rate of one every ten minutes or so. If someone sees it misbehaving, they can trigger the kill behavior. --Michael Mol 23:50, 14 November 2009 (UTC)
Okay. Now, if you insert the string "stopediting" here, UnderBot will stop editing. —Underscore (Talk) 16:02, 15 November 2009 (UTC)
IIRC (really not sure) it's standard on Wikipedia that any edit to the talk page stops the bot. --Kevin Reid 18:20, 15 November 2009 (UTC)
Do you have a user for the bot? I'll give it bot privs, which lets it use the API. --Michael Mol 21:11, 15 November 2009 (UTC)
nm. I'm some kind of idiot, I guess. It's got privs now. --Michael Mol 21:12, 15 November 2009 (UTC)
As of this morning, UnderBot is active. I turn off my computer at night, so it'll only be editing during the day. —Underscore (Talk) 15:45, 19 November 2009 (UTC)

Delay after null edits

When this bot finds a page that it doesn't need to edit, does it immediately seek out another page or does it wait for the next interval? If it waits, maybe you could shorten the wait when it doesn't edit to something like 30 seconds instead of ten minutes. --Mwn3d 20:14, 20 November 2009 (UTC)

It waits the full ten minutes, just because I didn't bother to make it smart enough to do otherwise. I figure there's no hurry. Pages that don't need any changes are relatively rare (out of nearly fifty pages UnderBot has looked at so far today, it left only one unchanged), and the whole job will be done before (the American) Thanksgiving in any case. —Underscore (Talk) 21:14, 20 November 2009 (UTC)

Change to correct case?

My impression is that the lang tags are case-sensitive? The bot doesn't seem to fix lang tags that have incorrect case -for example File Size#J. Are adjustments required?--Tikkanz 21:49, 20 November 2009 (UTC)

i think lang tags are not case-sensitive, but it's nice to have them standardized. --Mwn3d 21:54, 20 November 2009 (UTC)