Wikipedia:Bots/Requests for approval/Hazard-Bot 21

Hazard-Bot 21

[[User:Hazard-Bot|Hazard-Bot 21]]

{{Newbot|Hazard-Bot|21}}

Operator: {{botop|Hazard-SJ}}

Time filed: 01:33, Tuesday May 28, 2013 (UTC)

Automatic, Supervised, or Manual: Automatic

Programming language(s): Python

Source code available: [https://github.com/HazardSJ/English-Wikipedia/blob/master/citationstyle.py GitHub]

Function overview: Fixing citation style

Links to relevant discussions (where appropriate): bot request

Edit period(s): Periodic

Estimated number of pages affected: thousands

Exclusion compliant (Yes/No): Yes

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

Function details: Currently, it only fixes Help:CS1_errors#Wikilink_embedded_in_URL_title, but I might implement more fixes as well (would separate approval be required in that case, since it's still fixing CS1 errors?).  Hazard-SJ  ✈  01:33, 28 May 2013 (UTC)

=Discussion=

::# Does it fix parameters in {{tl|citation}}, or only those that start with "cite" or "web"? (noob question based on line 52)

::# Does it fix parameters that contain templates (e.g. {{diff|Aka Hoegh|prev|557038469|this edit}}), or should that be done in a separate bot task?

:Thanks! GoingBatty (talk) 01:58, 28 May 2013 (UTC)

  • Answers:
  • :# With that version of the code, only those starting with either "cite" or "web". I've just added support for {{tl|citation}} as well in [https://github.com/HazardSJ/English-Wikipedia/commit/7c12d355ed17fb75e53bd9126510ca61912c2585 this change], though I plan on coming up with a better and more specific list soon.
  • :# As of [https://github.com/HazardSJ/English-Wikipedia/commit/51c1668ff752810e67d1bc3fe44b6b6367e3c099 this change], it should remove templates as well.  Hazard-SJ  ✈  02:44, 28 May 2013 (UTC)
  • : You're welcome, and thanks for the code review ;)  Hazard-SJ  ✈  02:44, 28 May 2013 (UTC)

:{{BotTrial|edits=50}} ·Add§hore· Talk To Me! 08:33, 28 May 2013 (UTC)

::{{BotTrialComplete}} with [//en.wikipedia.org/w/index.php?title=Special:Contributions/Hazard-Bot&offset=20130529002700&limit=52&target=Hazard-Bot 52 edits]. Also, would I need separate approvals per what I mentioned above?  Hazard-SJ  ✈  00:29, 29 May 2013 (UTC)

:::I don't know if it requires separate approvals or not, but if it is all the same type of errors, couldn't you just trial an assortment of errors, BAG folk? -68.107.136.227 (talk) 03:13, 29 May 2013 (UTC)

:Seems useful, catches an error, although the explanation template is too much to read. -68.107.136.227 (talk) 22:43, 28 May 2013 (UTC)

These are surely not a good idea: [http://en.wikipedia.org/w/index.php?title=Alexandrov_topology&diff=prev&oldid=557256799] [http://en.wikipedia.org/w/index.php?title=Alexander_Alekhine&diff=prev&oldid=557256711] [http://en.wikipedia.org/w/index.php?title=Ahmed_Shafik&diff=prev&oldid=557256207]

This is also not ideal [http://en.wikipedia.org/w/index.php?title=Al_Jouf_University&diff=prev&oldid=557256241], a better outcome would be to shift the subscription flag to the citation's via parameter, e.g.: {{cite web|title=SAUDI ARABIA,UNITED STATES : Saudi's Al Jouf University Chooses Cisco WebEx, Offered in the Kingdom in Partnership With STC, for E-Learning. |via=HighBeam Research |url=

http://www.highbeam.com/doc/1G1-256221683.html|publisher=Mena Report|accessdate=23 August 2012|date=12 May 2011}}

Dragons flight (talk) 03:51, 29 May 2013 (UTC)

:[//github.com/HazardSJ/English-Wikipedia/commit/1b18ce6db904ec6655b517959ec93f668f2a21dc This commit] fixes the subscription issue (and potentially others?). I'm still considering about the {{tl|lang}} issues. Should I just remove the template, but leave the value of {{para|2}} which is the text itself, or put the entire citation template in the {{tl|lang}} template (I think this is unwise)? Otherwise I'd probably have to either just skip those errors, or set {{para|2}} to a null value before the citation template, leaving the actual value in the citation template. What do you suggest?  Hazard-SJ  ✈  07:02, 1 June 2013 (UTC)

::I suggest converting {{tl|lang}} to {{para|language}} and leaving the value of {{para|2}} in the {{para|title}} parameter (e.g. {{diff|Death_Magnetic|next|556513991|this edit}}), and then deleting any duplicated {{para|language}} parameter. GoingBatty (talk) 15:16, 1 June 2013 (UTC)

::I have an uncommitted fix for it, but I'm trying to work out [//en.wikipedia.org/w/index.php?title=Alexandrov_topology&diff=557905433&oldid=557900529 this issue] (see bug 2700).  Hazard-SJ  ✈  01:24, 2 June 2013 (UTC)

::Fixed in [//github.com/HazardSJ/English-Wikipedia/commit/04e7f89af005d06f6648e259376bf63d777c4b73 this commit].  Hazard-SJ  ✈  02:52, 2 June 2013 (UTC)

:::Is this ready for another trial? please {{tl|ping}} me with your response :) ·addshore· talk to me! 09:12, 2 June 2013 (UTC)

::::{{Ping|Addshore}} No, I'm not yet ready, I'd like to improve the code and add a few more features first. I'll keep you updated.  Hazard-SJ  ✈  22:59, 3 June 2013 (UTC)

::::{{Ping|Addshore}} [//github.com/HazardSJ/English-Wikipedia/commit/8600350a784904e292fe7dcd8dfdf56d106cc96e (diff)] I added some more features and did some code clean-up, so I think I'm ready again. As a side note, [//en.wikipedia.org/w/index.php?title=Special:Contributions/Hazard-Bot&offset=20130606004042&limit=31&target=Hazard-Bot these edits] were accidentally made, though with an outdated version of the code.  Hazard-SJ  ✈  02:36, 7 June 2013 (UTC)

::::::{{BotTrial|edits=50}} ·addshore· talk to me! 08:17, 7 June 2013 (UTC)

{{od}} {{BotTrialComplete}} ([//en.wikipedia.org/wiki/Special:Contributions/Hazard-Bot?offset=20130611041500&limit=55 edits])  Hazard-SJ  ✈  04:20, 11 June 2013 (UTC)

:* Edits such as {{diff|1920_Columbus_Panhandles_season|next|488290170|this one}} and {{diff|1920_Hammond_Pros_season|prev|559335517|this one}} look a bit odd. GoingBatty (talk) 04:36, 11 June 2013 (UTC)

  • [http://en.wikipedia.org/w/index.php?title=Template_talk:Citation/core/Archive_4&diff=prev&oldid=559336577] [http://en.wikipedia.org/w/index.php?title=Template_talk:Citation/core/Archive_4&diff=prev&oldid=559336577] [http://en.wikipedia.org/w/index.php?title=Template_talk:Cite_news/Archive_5&diff=prev&oldid=559336682] etc.
  • (Don't see this task explicitly listed, but I see you mention it in the discussion, so posting here) I strongly suggest you limit the automatic edits to article space, to avoid edits like [http://en.wikipedia.org/w/index.php?title=Wikipedia:Bots/Requests_for_approval/H3llBot_6&curid=32007543&diff=559336202&oldid=433218293 this]. We generally treat all bots as article-only, unless otherwise stated. In this case, it is not uncommon to have wrong citation style as examples or problem tests, and the bot should not assume other namespaces require automatic correction. —  HELLKNOWZ  ▎TALK 07:37, 11 June 2013 (UTC)
  • [//github.com/HazardSJ/enwiki/commit/e28e21eacd09159346156aaa89fd1d25e4f951b2 Fixed]  Hazard-SJ  ✈  03:46, 16 June 2013 (UTC)

:{{BotTrial|edits=50}} ·addshore· talk to me! 18:46, 16 June 2013 (UTC)

::Hazard, I'm not a pywikipedia expert and don't pretend to be, but doesn't page.namespace() just return the namespace number? I bet I'm just missing something, but an explanation'd be great. Thanks! Theopolisme (talk) 04:35, 17 June 2013 (UTC)

::: You're correct about it returning the namespace number, but remember that if 0 in Python returns False, and other digits return True, so in other words, if the namespace number is not zero, it continues to the next page.  Hazard-SJ  ✈  05:54, 18 June 2013 (UTC)

::::*headdesk*, duh :p Theopolisme (talk) 14:18, 18 June 2013 (UTC)

::::: {{BotTrialComplete}} ([//en.wikipedia.org/wiki/Special:Contributions/Hazard-Bot?limit=49&offset=20130622171000 edits]); I haven't checked them all as yet (it somehow only did 49, though), but an obvious problem so far is the comments being copied from archiveurl the url where present.  Hazard-SJ  ✈  17:14, 22 June 2013 (UTC)

::::::I only checked half the edits. Some of these edits may be garbage in, garbage out, but they look strange:

::::::*In {{diff|Brothers_Stoney|prev|561085184|this edit}} and {{diff|Ernie_Althoff|prev|561085869|this edit}}, I wouldn't expect {{tl|citation needed}} within {{tag|ref}}.

::::::*In {{diff|Comparison_of_HTML5_and_Flash&diff=prev&oldid=561085317|this edit}} and {{diff|Content_(media)|prev|561085495|this edit}}, the URLs were already in the {{para|deadurl}} parameter.

::::::*{{diff|Follia_d'amore|prev|561085979|This edit}} moved {{!}} from the {{para|title}} parameter to the end of the reference. — Preceding unsigned comment added by GoingBatty (talkcontribs) 03:21, 23 June 2013 (UTC)

:::::::I have raised similar concerns on your talk page and [//en.wikipedia.org/w/index.php?title=User:Hazard-Bot/DoTask/21&diff=561209352&oldid=557255710 disabled the task] for good measure. Graham87 14:13, 23 June 2013 (UTC)

The ongoing errors are a bit of a worry for me, especially as this bot is running in the article space. I'm leaning towards denying this task. --Chris 13:20, 24 June 2013 (UTC)

:I will leave out the part of the code that moves templates out of citation templates (maybe the language replacements are okay, since that's specifically hard-coded?). Also, I can code the bot to not make replacements in ref tags (as I did on a recently approved task). Also, I will have it check for {{para|deadurl}} as well.  Hazard-SJ  ✈  02:41, 25 June 2013 (UTC)

::{{tl|BAGAssistanceNeeded}} In response too what I've said, [//github.com/HazardSJ/enwiki/commit/0c8bf814b0663cbc00cce52a9a286adec4ab5218 may I have another trial please]?  Hazard-SJ  ✈  00:35, 3 July 2013 (UTC)

:{{BotTrial|edits=50}} ·addshore· talk to me! 12:01, 21 July 2013 (UTC)

::Started, only did [https://en.wikipedia.org/wiki/Special:Contributions/Hazard-Bot?offset=20130824043600&limit=12 these] so far, I'll try to finish when I get back online.  Hazard-SJ  ✈  04:02, 24 August 2013 (UTC)

:::In {{diff|Woman_(Wolfmother_song)|prev|569946564|this edit}}, the bot added {{para|archivedate|02 March 2012}} - the leading zero is not needed. It would also be nice (but too much to ask for?) if the bot could have detected that the reference already had an archivedate and was just missing the pipe. GoingBatty (talk) 14:07, 24 August 2013 (UTC)

:::: [https://github.com/HazardSJ/enwiki/commit/a82e2bdc03497c381bfbbf3eeee3c031cf52a41e This change] should strip the leading "0" if available. Also, as for the pipe issue, there might be (hopefully) few of such cases, and though I'm not sure if all such mistakes would all be in the same format, but if it's a frequent issue I could get a pattern to attempt it (running from false positives here).  Hazard-SJ  ✈  02:45, 25 August 2013 (UTC)

:::::I thought this task was about removing links and templates from citation templates, but these edits are fixing archive link errors...:Jay8g [VTE] 18:07, 25 August 2013 (UTC)

::::::This task focuses on errors related to citation templates, which include the archive links. As for the templates, it's better to have that part more specific (hard-code for certain templates only, because, as seen from the above, can cause many problems). IIRC, there isn't a problem with links. However, thanks for the mention, it caused me to look back at the code and notice that I disabled the entire link/template section rather than just that part that isn't specific as it pertains to templates (which, as I said, can be very troublesome). [//github.com/HazardSJ/enwiki/commit/c39f0004605a53fe5fc3bc60a34fdf54ac259d9b That has now been fixed in the code].  Hazard-SJ  ✈  05:15, 28 August 2013 (UTC)

{{od}} I'll also be adding [//en.wikipedia.org/w/index.php?title=Wikipedia:Bot_requests&oldid=570496002#Category:Pages_using_citations_with_accessdate_and_no_URL this], and as I mentioned before, possibly others in the future.  Hazard-SJ  ✈  06:07, 28 August 2013 (UTC)

: OK, [//github.com/HazardSJ/enwiki/commit/3755e84dfcf56716d60370fd2e6cde61e6d1a344 here it is].  Hazard-SJ  ✈  06:25, 28 August 2013 (UTC)

:: I just resumed the trial, and from the above code, got [//en.wikipedia.org/wiki/Special:Contributions/Hazard-Bot?limit=15&offset=20130828062828 these]. I however, stopped the trial to disable that part for now, so I can get some of the other parts involved.  Hazard-SJ  ✈  06:30, 28 August 2013 (UTC)

::: {{BotTrialComplete}} OK, continuing from above, I resumed with a trial that actually made [//en.wikipedia.org/wiki/Special:Contributions/Hazard-Bot?limit=49&offset=20130828071314 49 more edits]. It would have actually been 50, had the attempt to edit Georgia O'Keeffe actually been successful. The attempt was:

::: - On January 10, 1977, President Gerald R. Ford presented O'Keeffe with the Presidential Medal of Freedom, the highest honor awarded to American citizens.{{cite web |archiveurl=http://web.archive.org/web/20071024122700/http://www.medaloffreedom.com/GeorgiaOKeefe.htm |title=Georgia O'Keeffe|archivedate=October 24, 2008 |accessdate=June 1, 2010}} In 1985, she was awarded the National Medal of Arts.

::: + On January 10, 1977, President Gerald R. Ford presented O'Keeffe with the Presidential Medal of Freedom, the highest honor awarded to American citizens.{{cite web |archiveurl=http://web.archive.org/web/20071024122700/http://www.medaloffreedom.com/GeorgiaOKeefe.htm |title=Georgia O'Keeffe|archivedate=October 24, 2008 |accessdate=June 1, 2010|url=http://www.medaloffreedom.com/GeorgiaOKeefe.htm}} In 1985, she was awarded the National Medal of Arts.

::: which, according to my checks, failed because of a spam filter for medaloffreedom.com on MediaWiki:Spam-blacklist.

::: Error-wise, I picked up things like [//en.wikipedia.org/w/index.php?title=Grave_of_the_Fireflies_%282005_film%29&diff=prev&oldid=570499977], [//en.wikipedia.org/w/index.php?title=FMetro&diff=prev&oldid=570499540], [//en.wikipedia.org/w/index.php?title=Gaoqiao,_Kai_County&diff=prev&oldid=570499696], and [//en.wikipedia.org/w/index.php?title=Der_K%C3%B6nig_Kandaules&diff=prev&oldid=570498803], all of which are as a result of the bot not having a record of those language codes (well, at least one of them was invalid), and [//en.wikipedia.org/w/index.php?title=Dutch_East_Indies&diff=prev&oldid=570498980 this], which the bot wouldn't have been able to correctly fix. As for the first issue, I'll simply fix it by, firstly, updating the list of languages it's aware of, and secondly, to avoid repetition of this, the bot will no longer add {{#language:xx|en}}, but rather, either leave the {{tl|lang}} template or remove it there's already a language parameter set. I hope this request is more promising now. Thanks,  Hazard-SJ  ✈  07:39, 28 August 2013 (UTC)

== Language ==

{{ping|GoingBatty}} {{tl|lang}} and {{para|language}} do different things. Please read up on the former, which should not be removed without thought. {{ping|Hazard-SJ}} this page is difficult to read because of your garish sig. Please tone it down. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 19:58, 28 August 2013 (UTC)

:{{ping|Pigsonthewing}} - Template:Lang states "This template also includes a categorisation link when used by main namespace pages, therefore it should not be included inside a wikilink." Since the {{para|title}} parameter of {{tl|cite web}} contains a wikilink, using the {{tl|lang}} template within the {{para|title}} causes a visible categorisation error in the reference: see Compagnie des Transports Strasbourgeois for an example. Your thoughts on the best way to fix these errors would be appreciated. Thanks! GoingBatty (talk) 23:28, 28 August 2013 (UTC)

:: Correct.  Hazard SJ  08:17, 29 August 2013 (UTC)

::{{ping|GoingBatty}} Good: {{lang|fr|Zut alors!}}. Bad: {{lang. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 10:16, 29 August 2013 (UTC)

:::{{ping|Pigsonthewing}} - Also Bad: {{cite web|url=http://www.zutalors.fr|title={{lang|fr|Zut alors!}}}} — Preceding unsigned comment added by GoingBatty (talkcontribs) 17:20, 29 August 2013‎

::::{{ping|GoingBatty}} How else do you suggest that we mark up the titles of non-English works, such that the emitted HTML complies with HTML and WCAG standards? (And where would be a better place to discuss this issue; which is probably drifting from relevance here?) Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 22:30, 29 August 2013 (UTC)

::::: {{Ping|Pigsonthewing}} What exactly is your issue with {{para|language}}?  Hazard SJ  02:18, 30 August 2013 (UTC

::::::{{Ping|Hazard-SJ}} None whatsoever. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 16:29, 30 August 2013 (UTC)

::::: {{Ping|Pigsonthewing}} - I was suggesting that this bot be coded so it would change my example above to {{cite web|url=http://www.zutalors.fr|title=Zut alors!|language=French}}. If Hazard-SJ doesn't want to include that in the scope of this bot, then I agree we should stop discussing it here. GoingBatty (talk) 16:48, 31 August 2013 (UTC)

::::::{{ping|GoingBatty}} Yes; and my point is that that contains nothing that indicates tat the phrase "Zut alors!" is not English. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 17:10, 31 August 2013 (UTC)

:::::::{{Ping|Pigsonthewing}} - The {{para|language}} parameter indicates that the reference text (and therefore probably the title too) are not English. I'm open to alternate suggestions that do not produce errors. GoingBatty (talk) 17:40, 31 August 2013 (UTC)

::::::::{{ping|GoingBatty}} The use of {{para|language}} may suggest a probability that the title is in another language, but it does not guarantee it; and it does not indicate it in the emitted HTML, as does {{tl|lang}}, though the use of the appropriate HTML attribute, as described in the latter's documentation, to which I referred you earlier. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 17:58, 31 August 2013 (UTC)

:::::::::{{Ping|Pigsonthewing}} - Could you please provide an alternate suggestion for Hazard-SJ for removing the errors generated by using {{tl|lang}} in the {{para|title}} parameter? GoingBatty (talk) 18:17, 31 August 2013 (UTC)

::::::::::{{ping|GoingBatty}} What errors? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 17:21, 1 September 2013 (UTC)

:::::::::::{{Ping|Pigsonthewing}} - Sorry I haven't been able to explain this properly, so let me try again. Up above on June 1, I provided {{diff|Death_Magnetic|next|556513991|this edit}}, which fixed the Wikilink embedded in URL title error on {{oldid|Death Magnetic|557841413|reference 140 on the Death Magnetic article}}. Similarly, {{diff|Compagnie_des_Transports_Strasbourgeois|570924159|570498532|this edit}} by another editor fixed similar errors on {{oldid|Compagnie des Transports Strasbourgeois|570924159|references 21 and 42 on the Compagnie des Transports Strasbourgeois article}}. Both of these examples demonstrate that using {{tl|lang}} in the {{para|title}} parameter of a citation template produces a visible error and categorizes the article in :Category:Pages with citations having wikilinks embedded in URL titles, and that my suggestion to Hazard-SJ for fixing them is to remove {{tl|lang}} and use {{para|language}} instead. GoingBatty (talk) 00:30, 2 September 2013 (UTC)

{{od}}

{{ping|GoingBatty}} Thank you; I wasn't aware of you having attempted an explanation previously. {{tl|lang}} does not emit or cause to be emitted a link in the text which it contains; the issue appears to be the emitted category. The solution would therefore seem to be one of: ask for that template to not emit a category when used in a reference; change the way in which it emits a category;have a sister template for use in references, which dos not emit a category; or have the functionality embedded in the citation template core itself. the later is probably the most elegant solution. As I said above, {{para|language}} does not have the same functionality as {{tl|lang}} and is not a workable alternative to it. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 10:07, 2 September 2013 (UTC)

:P.S. In the interim, the template could be commented out, allowing its later reinstatement., Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 11:08, 2 September 2013 (UTC)

I seem to have missed out a lot here, but to put it simply, my bot has already had that feature for some time now. The current version works for both {{tl|lang}} and {{lang-xx}} style templates, as should be seen from the trials. In that case, if there's anything I missed, please let me know.  Hazard SJ  01:29, 3 September 2013 (UTC)