Wikipedia:Bots/Requests for approval/Theo's Little Bot 24
Tools
Actions
General
Print/export
In other projects
Appearance
From Wikipedia, the free encyclopedia
- 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 Approved.
Operator: Theopolisme (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 19:20, Sunday July 14, 2013 (UTC)
Automatic, Supervised, or Manual: Automatic
Programming language(s): Python
Source code available: who do you think i am?
Function overview: Converts publication_date
parameter in {{infobox poem}} to use {{start date}}. If unable to convert, adds the page to Category:Poem_publication_dates_needing_manual_review.
Links to relevant discussions (where appropriate): bot request
Edit period(s): One time run
Estimated number of pages affected:
Exclusion compliant (Yes/No): Nope
Already has a bot flag (Yes/No): Yes
Function details: For all pages that transclude {{infobox poem}}:
- if
publication_date
is present and actually contains a date:- parses the date into a datetime object using the dateutil Python module
- prints this date out into {{start date}}, with
df
parameter == y if the original format was DD Month YYYY - updates
publication_date
to be equal to the start date template with an html comment saying it was bot generated
- prints this date out into {{start date}}, with
- parses the date into a datetime object using the dateutil Python module
- if the bot was unable to parse, adds the page to hidden category Category:Poem_publication_dates_needing_manual_review
Discussion
[edit]- Support as requester. There is clear community consensus for this action. Perhaps need to make the tracking category more generic, for use on other infoboxes in futiure? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 21:37, 15 July 2013 (UTC)[reply]
- I was about to ask why you thought it needed to be more generic when you edit-conflicted me with an explanation. :) Sure, Category:Pages with infobox parameters needing manual conversion to start date... jeez, talk about unwieldiness. Any [more concise] ideas? Theopolisme (talk) 21:47, 15 July 2013 (UTC)[reply]
- Perhaps Category:Infoboxes needing manual conversion to use start date ? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 15:18, 16 July 2013 (UTC)[reply]
- Sounds like a winner. Theopolisme (talk) 15:25, 16 July 2013 (UTC)[reply]
- Perhaps Category:Infoboxes needing manual conversion to use start date ? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 15:18, 16 July 2013 (UTC)[reply]
- I was about to ask why you thought it needed to be more generic when you edit-conflicted me with an explanation. :) Sure, Category:Pages with infobox parameters needing manual conversion to start date... jeez, talk about unwieldiness. Any [more concise] ideas? Theopolisme (talk) 21:47, 15 July 2013 (UTC)[reply]
- {{BAGAssistanceNeeded}} A trial, perhaps? Theopolisme (talk) 21:27, 25 July 2013 (UTC)[reply]
- Approved for trial (20 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. Sorry for the delay. The template has few transclusions, so we'll go for a short trial. — Earwig talk 00:52, 1 August 2013 (UTC)[reply]
- Trial complete. Edits. The only issue was that, when restarted, it retagged [1] as being unparseable; I fixed this by checking first that the article wasn't tagged. Theopolisme (talk) 03:56, 1 August 2013 (UTC)[reply]
- Two things:
- This one looks like you could've parsed it fine with a small change to your algorithm (since you're using mwparserfromhell, add a
strip_code()
method call to the value of|publication_date=
before you run it throughparser.parser().parse()
, but after you check for {{start date}} or the category, since it will strip those too). - You shouldn't be changing parameter names here. It doesn't matter with {{chess diagram}} since that template seems to ignore those parameters anyway, but in other cases, this would break stuff. Again, looks related to mwparserfromhell; make sure you're updated to at least version 0.2, since it was fixed for that release.
- This one looks like you could've parsed it fine with a small change to your algorithm (since you're using mwparserfromhell, add a
- Other than that, looks good. — Earwig talk 02:30, 2 August 2013 (UTC)[reply]
- Two things:
- I've updated to the latest version of mwpfh, and modified the algorithm per your suggestion. Theopolisme (talk) 03:12, 2 August 2013 (UTC)[reply]
- Approved. Looks good. — Earwig talk 03:15, 2 August 2013 (UTC)[reply]
- 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.