Wikipedia:Bots/Requests for approval/Theo's Little Bot 10


 * 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

Theo's Little Bot 10
Operator:

Time filed: 01:55, Friday April 26, 2013 (UTC)

Automatic, Supervised, or Manual: Automatic

Programming language(s): Python + mwclient + mwparserfromhell

Source code available: on github

Function overview: Automatically archives old nominations at WP:TAFI, either moving them to an archive page (if unsuccessful) or to the TAFI holding area (if successful).

Links to relevant discussions (where appropriate): Wikipedia_talk:Today's_articles_for_improvement

Edit period(s): Daily

Estimated number of pages affected: 3 per month (TAFI noms page, TAFI monthly archive page, and TAFI holding area).

Exclusion compliant (Yes/No): No, unneeded

Already has a bot flag (Yes/No): Yes

Function details: For each nomination on Today's articles for improvement/Nominated articles...
 * If the nomination has a net support of 3 or more (wherein opposes count as -1), it is moved to the Today's articles for improvement/Holding area.
 * If the nomination has been inactive for 10 days and has less that 3 supports, the bot moves it to the current month's archive.

Discussion

 * Seems like an appropriate bot task, and you have community support via a request, straight forward, experienced operator, good communication. -166.137.210.34 (talk) 18:24, 26 April 2013 (UTC)
 * Accidentally did a test run with the bot account instead of my own to make sure replace method was working alright—which it was. Sorry about that. — Theopolisme ( talk )  19:42, 27 April 2013 (UTC)
 *  ·Add§hore·  Talk To Me! 09:47, 29 April 2013 (UTC)


 * Day 1 of trial complete - to nominations page, to holding area, to archive — Theopolisme ( talk )  11:11, 29 April 2013 (UTC)
 * Edits can be viewed at  Theopolisme  ( talk )  11:11, 4 May 2013 (UTC)
 * Would it be possible to stop the bot from leaving multiple new lines in a row?  ·Add§hore·  Talk To Me! 14:19, 2 May 2013 (UTC)
 * Sorry, I don't think I quite understand what you're talking about--could you give an example? Thanks,  Theopolisme ( talk )  02:13, 5 May 2013 (UTC)
 * This is the revision your bot made; notice that there is a blank line at the bottom of the Cantopop section. Before your bot edited there was not a blank line at the bottom of this section. -68.107.137.178 (talk) 09:08, 5 May 2013 (UTC)
 * Thanks for pointing that out. Hmm, I'm currently using the following regular expression to make each nomination: .  could you take a look, since you're the real wiz around here?  Theopolisme  ( talk )  12:38, 5 May 2013 (UTC)
 * It should be as simple as changing it to something like  I think!  ·Add§hore·  Talk To Me! 09:53, 7 May 2013 (UTC)
 * Thanks. Implemented on github.  Theopolisme ( talk )  11:12, 7 May 2013 (UTC)
 *  ·Add§hore·  Talk To Me! 12:06, 7 May 2013 (UTC)
 * Well, that didn't work. I tried  as well...which didn't work. Hmmm...are the newlines using some other character?  Theopolisme  ( talk )  11:27, 8 May 2013 (UTC)
 * A hacky solution that *works* for now is just replacing  with  .  Theopolisme  ( talk )  11:20, 9 May 2013 (UTC)

Can I get approval on this (prompted via Wikipedia_talk:Today's_articles_for_improvement)?  Theopolisme ( talk )  20:30, 14 May 2013 (UTC)
 * The comment directly above this says that you are using a "hacky solution"... Has that been resolved correctly? I would think that a requirement of approval would be "no hacky solutions", but as I'm a no-body here, I could be wrong.  FTR, I think this is a great idea and I support this bot, I just think it should be as hack/bug free as possible before approval. Coin Icon.svg Technical 13 (talk) 14:20, 15 May 2013 (UTC)
 * I agree that a non-hacky solution is called for. This is a long term, daily bot, can you try to fix this in a more robust way? -166.137.209.148 (talk) 17:44, 15 May 2013 (UTC)
 * I currently don't have the regular expression skills to resolve this on my own. I asked Legoktm for help, but he didn't respond. Anyone is welcome to comment, of course:  is the regex I'm using currently, and I need it to match newlines above and below the text in question.  Theopolisme  ( talk )  21:09, 15 May 2013 (UTC)
 * Firstly, shouldn't it be  and then, couldn't you go a little further and mark the start with   like   In order for me to refine it further (I think it will need it) I need to figure out exactly what you are trying to find and what you are replacing it with...  Unfortunately, I don't have quite that much time right this minute. Technical 13 (talk) 21:36, 15 May 2013 (UTC)
 * So you want to match the template, and any comment lines below? Stopping just before the next template?  ·Add§hore·  Talk To Me! 10:40, 18 May 2013 (UTC)
 * The regex I have now matches the template and all comment lines below, stopping just before the next template, yes. But I now also want to match any and all whitespace before the template...and  didn't work. Maybe  ?  Theopolisme  ( talk )  13:52, 18 May 2013 (UTC)
 * is the same as  which would actually catch those instances of there being just a space or a tab on a line that we can't see but throws the match off. Technical 13 (talk) 18:12, 18 May 2013 (UTC)
 * Tried ; didn't work. Here's the current code.  Theopolisme  ( talk )  13:48, 19 May 2013 (UTC)
 * →   Is it being greedy at the start and are there unusual spaces in the middle? Also, shouldn't the   near the end be escaped? Technical 13 (talk) 14:31, 19 May 2013 (UTC)
 * In the source code I linked, I was already using exactly what you just suggested. And yes, it was (already) escaped. Cheers, and thanks for your help,  Theopolisme ( talk )  20:53, 20 May 2013 (UTC)
 * Are we good to go for approval?  MBisanz  talk 03:11, 21 May 2013 (UTC)
 * Good for me if the bot operator thinks the spacing issue is covered, maybe run through initial edits himself and confirm, but it seems good to me. -166.137.209.152 (talk) 12:53, 22 May 2013 (UTC)
 * All good here; ready for approval.  Theopolisme ( talk )  21:49, 23 May 2013 (UTC)
 *  ·Add§hore·  Talk To Me! 21:50, 23 May 2013 (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.