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 Symbol keep vote.svg Approved.

DASHBot 7
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. &mdash; The   Earwig   @  07:29, 2 January 2010 (UTC))

Exclusion compliant (Y/N): Y

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

Function details: Syntax:
 * 1) Get Article text.
 * 2) Get contents of Infobox Album (including nested templates)
 * 3) Get contents of |Rating parameter (including nested templates)
 * 4) Remove parameter and contents from template
 * 5) Split contents by (newline)*
 * 6) For each review, seperate into two parts: Reviewer and Score
 * 7) Turn all html links into references, name them "Reviewer" Review
 * 8) Put all content into Album ratings
 * 9) Look for the first  section that contains any of the following: Reception,Review,critical,Release ; put Album ratings at beggining
 * 10) 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.
 * 11) if none is found, use first section as section; create section named "Reception", put Album ratings at begining and Arprose at the end.
 * 12) Go to next.

Discussion

 * 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)
 * 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)
 * Some Sample edits Tim1357 (talk) 06:43, 2 January 2010 (UTC)


 * You didn't mention whether the bot was supervised or unsupervised. I assume that once approved, the bot will run fully unsupervised, yes? &mdash; The   Earwig   @  07:29, 2 January 2010 (UTC)
 * 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)

 MBisanz  talk 00:50, 3 January 2010 (UTC)
 * Thanks, I appreciate this because there are lots of little errors that need fixing. Tim1357 (talk) 16:28, 3 January 2010 (UTC)
 * I'm stuck right now on one error. The following regex:

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)
 * 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)
 * 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)
 * Being a little more specific, try:

{{[\s_]*Infobox[\s_]Album(({{(({{(({{[^\}]*?}})|.)*}})|.)*}})|.)*}}
 * Mind you, that's theoretical, without test data, so YMMV Josh Parris 04:48, 9 January 2010 (UTC)
 * The difficult page is Bookends Josh Parris 05:19, 9 January 2010 (UTC)
 * 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)
 * ✅ 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)

Just be sure that the edit summaries are fixed. ( X! ·  talk )  · @291  · 05:58, 25 January 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.