Wikipedia:Bots/Requests for approval/H3llBot 4


 * The following discussion is an archived debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA. The result of the discussion was Symbol keep vote.svg Approved.

H3llBot 4
Operator:

Automatic or Manually assisted: Automatic

Programming language(s): WikiSharpAPI (C#)

Source code available: Not now, I will make API available when it's actually usable.

Function overview: Reference and citation maintenance

Links to relevant discussions (where appropriate): Bot_requests/Archive_35, User_talk:H3llBot.

Edit period(s): Continuous (when I'm online)

Estimated number of pages affected: All encountered pages with issues, limited by main archival task speed (5-8epm), I suspect this task will raise this to 6-9epm.

Exclusion compliant (Y/N): Y

Already has a bot flag (Y/N): Y

Function details:

1) If a citation's url is a valid Wayback archive link, set archiveurl and archivedate to match it and trim the url to the original link, if
 * no archiveurl is set -and-
 * no archivedate is set -or- archivedate is of broken syntax/unrecognised -or- archivedate is the same as actual link's archive date

2) Remove Wayback template and add corresponding archiveurl and archivedate in the preceding citation if
 * Wayback has url set and date set, and title not set or equal to citation's title -and-
 * citation has no archiveurl set and no archivedate set, and with url matching Wayback's url


 * See example for both fixes.

X) As an addition, I want to improve the previous task's (BRFA, description) functionality a bit:

When adding archivedate to a citation
 * If one of Use dmy dates, Use mdy dates, or Use ymd dates templates is present, use that respective date format for the field
 * Otherwise use citation's accessdate (or date if former is missing/invalid) date format
 * Otherwise use yyyy-mm-dd (e.g. 2010-12-31) date format

Discussion
I hope you mean yyyy-mm-dd! Rich Farmbrough, 21:04, 30 September 2010 (UTC).
 * Oh - and that's a great improvement to a great task. Rich Farmbrough, 21:05, 30 September 2010 (UTC).
 * Yes, yyyy-mm-dd, my bad; the code uses Ymd, so all's well! Also, thanks. — HELL KNOWZ  ▎TALK 21:59, 30 September 2010 (UTC)

 MBisanz  talk 22:46, 19 October 2010 (UTC)


 * Done. edits here. — HELL KNOWZ  ▎TALK 19:41, 7 November 2010 (UTC)
 * I see a number of cases where the bot created dates like "28-09-2007":
 * I also see a few cases where you copied the format of date when accessdate did exist and had a valid format, for example the second 2 in . Anomie⚔ 01:02, 19 November 2010 (UTC)
 * D Any reply? Anomie⚔ 03:20, 24 November 2010 (UTC)
 * Yes, thanks for reply. I got so paranoid about not accidentally adding dmy after Rich's comment that I went and ended up doing exactly that... Regarding date before accessdate, I checked them in reverse order. I also did not first check if the date is valid, so the bad date params caused the bot to default to dmy, which in turn was ymd. Should be OK in recognising formats now . ymd format: one edit was fixed, one fixed manually, bot-fixed rest: . accessdate priority: Bot-fixed: . Hopefully I didn't miss anything. Sorry for the mess, I was definitely far over Ballmer's peak at the time. —  HELL KNOWZ  ▎TALK 11:53, 24 November 2010 (UTC)
 * Is correct? It seems to have chosen 13 May 2008 even though the accessdate is 2010-11-07. Also, I see in your sandbox edit that the bot output dates as "28/09/2007", "2007/09/28", and "28-09-2007". The bot should never output any of those formats, even if some misguided human did use them. The bot should always output either "September 28, 2007", "28 September 2007", or "2007-09-28". Anomie⚔ 16:09, 24 November 2010 (UTC)
 * The Iran article has a Use dmy dates template, so that instance should be correct. Regarding digit separator, the bot attempted to mimic the original date format's separator ("/", "\", "."). I will disable this. Similarly, I will then only allow the "M d, y", "d M y" and "y-m-d" formats. I don't have the irc logs any more, but I ran a date format check in summer and "28-09-2007" appeared roughly as often as "September 28, 2007" did. This is why I was allowing this format as well. There are featured articles using dmy only. But I suppose "Do not use year-final numerical date formats.." surpasses "Dates in article references should all have the same format." Will post a sandbox edit in the evening. — HELL KNOWZ  ▎TALK 16:34, 24 November 2010 (UTC)
 * sandbox edit. Ignoring separators and not using dmy. — HELL KNOWZ  ▎TALK 09:16, 25 November 2010 (UTC)
 * Ah, ok on the Iran page. Sandbox edit looks good now. Anomie⚔ 16:08, 25 November 2010 (UTC)
 * The above discussion is preserved as an archive of the debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA.