Wikipedia:Bots/Requests for approval/HairBot


 * 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 oppose vote.svg Withdrawn by operator.

HairBot
Operator:

Time filed: 01:34, Saturday October 27, 2012 (UTC)

Automatic, Supervised, or Manual: Automatic

Programming language(s): Python

Source code available: Yes

Function overview: Removes the dead end tag on pages if it doesn't apply

Links to relevant discussions (where appropriate):

Edit period(s): Every 3 days

Estimated number of pages affected: 200-300 pages over a month, can grow over time

Exclusion compliant (Yes/No): Yes

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

Function details: Bot goes through all pages categorized as a dead end page. If it has more than 1 or more links on the page to another mainspace article, it'll remove the tag. It'll remove the template(s) in the following conditions:
 * If  or   found on the page and if it applies.
 * If  is found on the page and if it applies. Also, as it'd leave issue in multiple issues and nothing else, it'd transform issue back into it's original template (turning   into  ) only if necessary.

Discussion
Both and  have redirects your regex doesn't account for. Additionally, instead of using, you can just use the   flag. Legoktm (talk) 07:01, 27 October 2012 (UTC)
 * If you ignore case, you also match non-existant templates with weird capitalization. Not a problem here per se, but it can happen (can't find that list of different templates whose titles only differ in capitalization). — HELL KNOWZ  ▎TALK 21:41, 27 October 2012 (UTC)


 * I have several comments.
 * Line 1: The PEP 8 recommends one import statement for each module imported.
 * Line 7: An empty container will return False in a boolean context. if pages: is the preferred way of checking if a list is not empty.
 * Line 10: 2013 will arrive in a little over two months. When that happens, the script will break ( getpages will return None, which cannot be iterated over in line 29).
 * Line 18: Don't compare boolean values to True or False using ==.
 * Lines 19-21: Is there any reason you're using regex over a real template parser?
 * → Σ σ  ς . (Sigma) 07:20, 27 October 2012 (UTC)
 * Line 1, Line 7 and Line 18: As it seems this is only a recommendation and the preferred way, it has never come across to me to do this. I'll fix that in the code now.
 * Line 10: To my understanding, this won't break/return None. By default, 2012 is the year (as that is what the current dead end pages are). As it goes through each month and reaches december, the year increases by 1, if that year is greater than the current year, it returns all the pages in returnlist. Is there an issue that I'm not aware of?
 * Line 19-21: I've never used mwparserfromhell, though you have told about it to me before! I'd rather use something that I am more familiar with, rather than a new tool.
 *  Hair Talk 21:27, 27 October 2012 (UTC)

"If it has more than 1 or more links on the page to another mainspace article, it'll remove the tag." How do you detect this? (Sorry I don't look through code, but we document the process and actual implementation is up to you, as long as it works ok.) What about links from navboxes, templates, infoboxes, etc.? — HELL KNOWZ  ▎TALK
 * This is an API action (example on Foobar article), it's an easy way to find links.  Hair Talk 00:38, 29 October 2012 (UTC)
 * So the bot does not account for false positives? If I was to place something like, it would think there's a link. — HELL KNOWZ  ▎TALK 08:29, 29 October 2012 (UTC)

Multiple issues is not used as you describe it anymore, we now use full templates inside it. Though old syntax is still around (for now). — HELL KNOWZ  ▎TALK 21:41, 27 October 2012 (UTC)
 * I'm aware of this and have accounted for this in the regex, thanks for pointing that out though.  Hair Talk 00:38, 29 October 2012 (UTC)

There is also the underlinked template, which should be used for articles, once there are a few links, but clearly not enough. The bot wouldn't be able to detect this, and I'm wondering if this would be a requirement. Similar example would be a bot task that removes unreferenced and adds refimprove (we have a couple of those). — HELL KNOWZ  ▎TALK 08:29, 29 October 2012 (UTC)
 * I can easily add this into HairBot (and will do that now). I'm glad you pointed this out to me as I didn't think of involving this into HairBot.  Hair Talk 01:35, 6 November 2012 (UTC)
 * It is now added into the script.  Hair Talk 01:32, 9 November 2012 (UTC)

 MBisanz  talk 23:44, 9 November 2012 (UTC)
 * I'm still interested how the bot avoids false positives. — HELL KNOWZ  ▎TALK 08:42, 10 November 2012 (UTC)

- Before the trial began, I decided to switch to mwparserfromhell after seeing the potential it has. Because of this integration the trial started off a bit rough, but at the end everything went perfectly well. Example edits:.  Hair Talk 22:58, 11 November 2012 (UTC)
 * Please make the summary more descriptive and link to this BRFA or some explanation of what the bot is doing. — HELL KNOWZ  ▎TALK 08:40, 12 November 2012 (UTC)

These pages have no direct prose links:                        (and other eclipse ones)        

Some have no links at all, some have links in navboxes and other templates, that aren't generally considered proper inline linking for dead end purposes (you could clarify this; although, in the end, prose still has no links).

These are borderline:     — HELL KNOWZ  ▎TALK 08:40, 12 November 2012 (UTC)

- There are obviously some issues that aren't accounted for in the script. I'd rather spend my time working on a script rather useful instead of a script that continues to fail.  Hair Talk 01:59, 13 November 2012 (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.