Wikipedia:Bots/Requests for approval/DASHBot 7
- 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: Tim1357
Automatic or Manually assisted:
Programming language(s): Python
Source code available:I dont want you to throw up; its pretty ugly.
Function overview: Per the nearly 150 kilobytes of conversation at Wikipedia talk:WikiProject Albums (permalink), the bot moves rating in the |Ratings= parameter of {{Infobox Album}} to the newly created {{Album ratings}}.
Links to relevant discussions (where appropriate): See above
Edit period(s): Once, with perhaps a run afterwards to clean up what I miss.
Estimated number of pages affected: From my testing I'd say maybe half of all articles with {{Infobox Album}} (If this is true, the bot would edit approx. 45,000 pages. — The Earwig @ 07:29, 2 January 2010 (UTC))[reply]
Exclusion compliant (Y/N): Y
Already has a bot flag (Y/N): Y
Function details: Syntax:
- Get Article text.
- Get contents of Infobox Album (including nested templates)
- Get contents of |Rating parameter (including nested templates)
- Remove parameter and contents from template
- Split contents by (newline)*
- For each review, seperate into two parts: Reviewer and Score
- Turn all html links into references, name them "Reviewer" Review
- Put all content into {{Album ratings}}
- Look for the first section that contains any of the following: Reception,Review,critical,Release ; put {{Album ratings}} at beggining
- If none is found, look for section that contains Track (as in Track Listing); create section before it named "Reception", put {{Album ratings}} at begining and {{Arprose}} at the end.
- if none is found, use first section as section; create section named "Reception", put {{Album ratings}} at begining and {{Arprose}} at the end.
- Go to next.
Discussion
[edit]- If this bot makes it to the trial stage, I request an extended trial. This is because 90% of the work I did for the bot was in regex. It is hard to see errors in regular expression code, and the only way I think I will find those errors is by testing the bot in the real world. Tim1357 (talk) 06:33, 1 January 2010 (UTC)[reply]
- Note: I added a link to the source code. I only included the bits that I wrote, because everything else utilizes what is in basic.py (the basic frameworks for pywikipedia) Tim1357 (talk) 05:39, 2 January 2010 (UTC)[reply]
- Some Sample edits Tim1357 (talk) 06:43, 2 January 2010 (UTC)[reply]
- You didn't mention whether the bot was supervised or unsupervised. I assume that once approved, the bot will run fully unsupervised, yes? — The Earwig @ 07:29, 2 January 2010 (UTC)[reply]
- Oh, verry sorry. Yes, once I am confident that the bot will not damage anything, then I will let it go un-supervised. Tim1357 (talk) 15:41, 2 January 2010 (UTC)[reply]
Approved for extended trial. Please provide a link to the relevant contributions and/or diffs when the trial is complete. MBisanz talk 00:50, 3 January 2010 (UTC)[reply]
- Thanks, I appreciate this because there are lots of little errors that need fixing. Tim1357 (talk) 16:28, 3 January 2010 (UTC)[reply]
- I'm stuck right now on one error. The following regex:
- Thanks, I appreciate this because there are lots of little errors that need fixing. Tim1357 (talk) 16:28, 3 January 2010 (UTC)[reply]
{{[\s_]*Infobox[\s_]Album(({{(({{(({{.*?}})|.)*}})|.)*}})|.)*}}
which is supposed to match only the contents of the Infobox Album template, matches way much more then it is supposed to. Any Ideas? Tim1357 (talk) 04:34, 9 January 2010 (UTC)[reply]
- I find that rather than using
.*?
you ought to try[^\}\|]*?
when matching template names; for template contents drop the\|
Josh Parris 04:41, 9 January 2010 (UTC)[reply]- Ok I changed *? to * but that dosen't change anything with my problem. Also
[^\}\|]*?
stops at the first "|", which does not work in my case. Tim1357 (talk) 04:44, 9 January 2010 (UTC)[reply]- Being a little more specific, try:
- Ok I changed *? to * but that dosen't change anything with my problem. Also
{{[\s_]*Infobox[\s_]Album(({{(({{(({{[^\}]*?}})|.)*}})|.)*}})|.)*}}
- Mind you, that's theoretical, without test data, so YMMV Josh Parris 04:48, 9 January 2010 (UTC)[reply]
- The difficult page is Bookends Josh Parris 05:19, 9 January 2010 (UTC)[reply]
- Ok, I think I found a solution. Its pretty cheap, but It works. Im continuing the trial now, and will try to get 50 pages edited without an error. Tim1357 (talk) 21:45, 19 January 2010 (UTC)[reply]
- Done See the log. I know the edit summary is screwed up in the latter parts. Its an easy fix. I think I didn't miss anything other then that.... Tim1357 (talk) 00:32, 20 January 2010 (UTC)[reply]
- Ok, I think I found a solution. Its pretty cheap, but It works. Im continuing the trial now, and will try to get 50 pages edited without an error. Tim1357 (talk) 21:45, 19 January 2010 (UTC)[reply]
Approved. Just be sure that the edit summaries are fixed. (X! · talk) · @291 · 05:58, 25 January 2010 (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.