Wikipedia:Bots/Requests for approval/Petan-Bot task8


 * 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 neutral vote.svg Request Expired.

User:Petan-Bot
Operator:

Time filed: 16:14, Wednesday April 20, 2011 (UTC)

Automatic or Manual: Automatic

Programming language(s): c++

Source code available: available

Function overview: Do http://en.wikipedia.org/wiki/Wikipedia:Bot_requests#Alteration_of_a_template_from_.22Wikisource1911Enc_Citation.22_to_.22Cite_EB1911.22

Links to relevant discussions (where appropriate): http://en.wikipedia.org/wiki/Template_talk:Cite_EB1911

Edit period(s): one time

Estimated number of pages affected: many as database scan found more than 4000 pages which use it

Exclusion compliant (Y/N): Y

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

Function details: Replace tag with new version and copy the parameters if set if not set default

Discussion
Example: User:Petan-Bot/Sandbox01 (see diff)

 MBisanz  talk 10:10, 21 April 2011 (UTC)

Petrb (talk) 11:35, 23 April 2011 (UTC)
 * Kingpin13, on irc, wanted to know what is real reason for this task as it could be done by updating the template (maybe) so it would be good if User:PBS who requested this explained why it needs to be done this way. Petrb (talk) 18:58, 23 April 2011 (UTC)


 * There is a template called Cite EB1911 to which Wikisource1911Enc Citation is a redirect, but 1911 calls Cite EB1911 as well. 1911 is found in over 10,000 articles. For historical reasons most instances of that template does not have any parameters what so ever. Without an article parameter, it is not of much use because what the article that use it are saying is "Some of the text in this Wikipedia article comes from a page somewhere in the 29 volumes of the Encyclopædia Britannica Eleventh Edition". To meet WP:Plagarism and WP:CITE we need to add the article name to the 10,000 instances of 1911. But at the moment Cite EB1911 has some legacy code to deal with Wikisource1911Enc Citation, but it does not deal correctly with Wikisource1911Enc Citation no parameter (which should use the name of the article) and although it deals with Wikisource1911Enc Citation's unnamed parameter correctly this is a problem because it unmannerly complicates the code in Cite EB1911 and it also makes the assumption that the article exists in wikisource, and at the moment most articles are not on wikisource (the reason we have wstitle= for wiksource and title= url= for non wikisource articles).


 * Once this change is made we will be able to add a visual prompt that will appear in each instance of the template asking for an article name to be added (see DGRG for an example of one way it could be displayed). This is not possible at the moment as the Wikisource1911Enc Citation may legitimately have no title parameters. -- PBS (talk) 09:10, 24 April 2011 (UTC)

Petrb I had a look at your sandbox and the results are not correct. What is needed is to covert Wikisource1911Enc Citation to  for those entries with a parameter and    for those instances of the template without a parameter. If you can handle the instances that include noicon= parameter so much the better, but if not then just exception them and I'll deal with them using AWB. I presume that your bot will make an archive of the pages it changes in its history a start time and end time would be very useful, so I can sample and check them. -- PBS (talk) 09:23, 24 April 2011 (UTC)

I have taken the liberty of editing your sandbox here is a diff of how the output should appear. -- PBS (talk) 09:43, 24 April 2011 (UTC)

What was the scan that was used to come to 4,000? Using "link" and also AWB there are "only" 1175 instances in article space and about another 30 in other spaces that need not/should not be altered. -- PBS (talk) 09:43, 24 April 2011 (UTC)

I have been through the list of edits its not good news: {{collapse bottom}}
 * 1) Correct template, but no |wstitle= parameter 11:52, 23 April 2011 (diff | hist) William Law ‎ (Converting - Wikisource1911Enc)
 * 2) Correct template, but no |wstitle= parameter 11:51, 23 April 2011 (diff | hist) Edward Irving ‎ (Converting - Wikisource1911Enc )
 * 3) Correct template, but no |wstitle= parameter11:51, 23 April 2011 (diff | hist) Karl Baedeker ‎ (Converting - Wikisource1911Enc )
 * 4) Correct template, but no |wstitle= parameter 11:51, 23 April 2011 (diff | hist) Forty-Eighters ‎ (Converting - Wikisource1911Enc )
 * 5) Correct template, but no |wstitle= parameter 11:50, 23 April 2011 (diff | hist) Helenius Acron ‎ (Converting - Wikisource1911Enc )
 * 6) Correct template, but no |wstitle= parameter 11:50, 23 April 2011 (diff | hist) Aulos ‎ (Converting - Wikisource1911Enc )
 * 7) Correct template, but no |wstitle= parameter 11:50, 23 April 2011 (diff | hist) Waziristan ‎ (Converting - Wikisource1911Enc )
 * 8) Correct template, but no |wstitle= parameter 11:49, 23 April 2011 (diff | hist) Miag-ao, Iloilo ‎ (Converting - Wikisource1911Enc )
 * 9) Correct template, but no |wstitle= parameter 11:49, 23 April 2011 (http://en.wikipedia.org/w/index.php?title=Sigismond_Thalberg&diff=prev&oldid=425483235 diff] | hist) Sigismond Thalberg ‎ (Converting - Wikisource1911Enc )
 * 10) Wrong template "1911"  11:49, 23 April 2011 (diff | hist) Grampian Mountains ‎ (Converting - Wikisource1911Enc )
 * 11) Not article space. Failed to add |wstitle= 11:48, 23 April 2011 (diff | hist) Talk:Harpsichord ‎ (Converting - Wikisource1911Enc )
 * 12) Correct template added correct parameter when previously not one available ✅ 11:48, 23 April 2011 (diff | hist) Aventurine ‎ (Converting - Wikisource1911Enc )
 * 13) Correct template, but no |wstitle= parameter 11:48, 23 April 2011 (diff | hist) John Torrey ‎ (Converting - Wikisource1911Enc )
 * 14) Correct template, but no |wstitle= parameter  11:47, 23 April 2011 (diff | hist) Thomas John Dibdin ‎ (Converting - Wikisource1911Enc )
 * 15) Correct template, but no |wstitle= parameter 11:47, 23 April 2011 (diff | hist) Talk:P. T. Barnum ‎ (Converting - Wikisource1911Enc)
 * 16) Correct template, but no |wstitle= parameter 11:47, 23 April 2011 (diff | hist) Joseph Swan ‎ (Converting - Wikisource1911Enc )
 * 17) Correct template, but no |wstitle= parameter 11:46, 23 April 2011 (diff | hist) North Rhine-Westphalia ‎ (Converting - Wikisource1911Enc)
 * 18) Correct template, but no |wstitle= parameter 11:46, 23 April 2011 (diff | hist) Killer whale ‎ (Converting - Wikisource1911Enc )
 * 19) Correct template added correct parameter when previously not one available ✅ 11:46, 23 April 2011 ([ diff] | hist) Barlaam and Josaphat ‎ (Converting - Wikisource1911Enc )
 * 20) Correct template added correct parameter when previously not one available ✅ 11:45, 23 April 2011 (diff | hist) Euphonium ‎ (Converting - Wikisource1911Enc)
 * 21) Wrong template "1911" 11:39, 23 April 2011 (diff | hist) Abraham ‎ (Converting - Wikisource1911Enc)
 * 22) Wrong template "1911" 11:38, 23 April 2011 (diff | hist) Angilbert ‎ (Converting - Wikisource1911Enc )
 * 23) Wrong template "1911" 11:38, 23 April 2011 (diff | hist) Ahab ‎ (Converting - Wikisource1911Enc )
 * 24) Wrong template "1911" 11:38, 23 April 2011 (diff | hist) Alabaster ‎ (Converting - Wikisource1911Enc )
 * 25) Wrong template "1911" 11:37, 23 April 2011 (diff | hist) Amalaric ‎ (Converting - Wikisource1911Enc )
 * 26) Wrong template "1911" 1911Wrong template "1911EB"  11:37, 23 April 2011 (diff | hist) Amber ‎ (Converting - Wikisource1911Enc)
 * 27) Wrong template "1911" 11:37, 23 April 2011 (diff | hist) Ambracia ‎ (Converting - Wikisource1911Enc)
 * 28) Wrong template "1911" 11:36, 23 April 2011 (diff | hist) Ambrose ‎ (Converting - Wikisource1911Enc )
 * 29) Wrong template "1911" 11:36, 23 April 2011 (diff | hist) Amethyst ‎ (Converting - Wikisource1911Enc)
 * 30) Wrong template "1911" 11:35, 23 April 2011 (diff | hist) Ammonia ‎ (Converting - Wikisource1911Enc )
 * 31) Wrong template "1911" 11:35, 23 April 2011 (diff | hist) Anbar (town) ‎ (Converting - Wikisource1911Enc )
 * 32) Wrong template "1911" 11:35, 23 April 2011 (diff | hist) Abbey ‎ (Converting - Wikisource1911Enc )
 * 33) Wrong template "1911" 11:34, 23 April 2011 (diff | hist) Abbess ‎ (Converting - Wikisource1911Enc
 * 34) Wrong template "1911" 11:34, 23 April 2011 (diff | hist) Apocrypha ‎ (Converting - Wikisource1911Enc )
 * 35) Wrong template "1911" 11:34, 23 April 2011 (diff | hist) Actaeon ‎ (Converting - Wikisource1911Enc )
 * 36) Wrong template "1911"  11:33, 23 April 2011 (diff | hist) Angle ‎ (Converting - Wikisource1911Enc )
 * 37) Wrong template "1911" 11:33, 23 April 2011 (diff | hist) Anaximander ‎ (Converting - Wikisource1911Enc - ) (top)
 * 38) Wrong template "1911" 11:32, 23 April 2011 (diff | hist) Abbot ‎ (Converting - Wikisource1911Enc )
 * 39) Wrong template "1911" 11:32, 23 April 2011 (diff | hist) Augustin-Jean Fresnel ‎ (Converting - Wikisource1911Enc )
 * 40) Wrong template "1911" 11:32, 23 April 2011 (diff | hist) Avicenna ‎ (Converting - Wikisource1911Enc)
 * 41) Wrong template "1911" 11:31, 23 April 2011 (diff | hist) Aaron ‎ (Converting - Wikisource1911Enc )
 * 42) Wrong template "1911" 11:31, 23 April 2011 (diff | hist) April ‎ (Converting - Wikisource1911Enc)
 * 43) Wrong template "1911EB" 11:30, 23 April 2011 (diff | hist) Arsenic ‎ (Converting - Wikisource1911Enc )
 * 44) Wrong template "1911" 11:30, 23 April 2011 (diff | hist) Allegiance ‎ (Converting - Wikisource1911Enc )
 * 45) Wrong template "1911" 11:29, 23 April 2011 (diff | hist) Amsterdam ‎ (Converting - Wikisource1911Enc)
 * 46) Wrong template "1911" 11:28, 23 April 2011 (diff | hist) Aquarius (constellation) ‎ (Converting - Wikisource1911Enc,  ) (top)
 * 11:25, 23 April 2011 (diff | hist) Antoninus Pius ‎ (Converting - Wikisource1911Enc, )
 * 17:42, 20 April 2011 (diff | hist) User:Petan-Bot/Sandbox01 ‎ (Converting - {{{Wikisource1911Enc, )
 * 17:18, 20 April 2011 (diff | hist) User:Petan-Bot/Sandbox01 ‎ (Converting -Wikisource1911Enc, )

-- PBS (talk) 16:16, 28 April 2011 (UTC)
 * Is it possible to undo all the incorrect edits?
 * Is there anything in the description of what I wanted the bot to do that is not clear?
 * Is it possible to repeat the test on say the sandbox and then the 10 most recent articles that the bot edited?
 * Ok currently it's not clear if this task get approved if not I will revert it if yes I will have my bot fix it, we are now waiting for BAG to respond Petrb (talk) 17:48, 28 April 2011 (UTC)
 * As they are article pages I think that all the incorrect edits should be reverted ASAP.
 * Who decides if this task shoudl be approved (I am not familiar with this process and do not recognise terms like BAG and links to first use of such terms helps a beginner like me))? -- PBS (talk) 08:22, 29 April 2011 (UTC)
 * WP:BAG (Bot Approvals Group) does. — HELL KNOWZ  ▎TALK


 * Petrb, per WP:BOTPOL, you must repair all errors caused by the bot edits: "The contributions of a bot account remain the responsibility of its operator, who must be prominently identifiable on its user page. In particular, the bot operator is responsible for the repair of any damage caused by a bot which operates incorrectly." You do not need approval to manually revert/fix the edits. — HELL KNOWZ  ▎TALK 08:30, 29 April 2011 (UTC)
 * Sorry but I don't see what is wrong if you have a template which is redirect to another and my bot only change it to the one which it was redirected to it doesn't change anything, why I should revert it? Petrb (talk) 17:44, 29 April 2011 (UTC)
 * I did not say what specific edits you have to revert, because I have not inspected them closely. I made the comment in light of user PBS saying "Is it possible to undo all the incorrect edits?" and "As they are article pages I think that all the incorrect edits should be reverted ASAP." strongly implying there are erroneous edits. You then replied "Ok currently it's not clear if this task get approved if not I will revert it if yes I will have my bot fix it" suggesting you are waiting for approval/decline before proceeding with "fixing". So I commented that BRFA status does not change the operator's responsibility of fixing the wrong edits (whether applicable or not in this case). — HELL KNOWZ  ▎TALK 17:51, 29 April 2011 (UTC)
 * Wrong edits were fixed cosmetic changes will be fixed by bot if the task get approved or reverted if requested. Petrb (talk) 17:59, 29 April 2011 (UTC)
 * Wrong edits have not been fixed. All of the ones I flagged with a Cross are wrong. Changing 1911 to Cite EB1911 removes the attribution string and is a breach of WP:PLAGARISM. As you bot has not been requested to edit the pages that include Cite EB1911 the ones you have converted without the wstitle= parameter are wrong and need converting back. It you will have to do these by hand then I will help you by converting them back. -- PBS (talk) 12:10, 30 April 2011 (UTC)

So I understand it now that tag should be replaced for redirect and wstitle added if there is unnamed parameter or nothing? another template should only get parameter if missing? example: Wikisource1911Enc to Cite EB1911|wstitle={{subst:PAGENAME}}, Cite EB1911 to Cite EB1911|wstitle={{subst:PAGENAME}} and {{1911}} to 1911|wstitle={{subst:PAGENAME}} Petrb (talk) 18:10, 29 April 2011 (UTC)


 * Feel free to create Petan-Bot / Sandbox08-20 pages and I will have my bot change them so that you can check it Petrb (talk) 18:12, 29 April 2011 (UTC)


 * 1911 is not a redirect! The use of that template on any page should not be touched. There is a history to these templates and whether they are a redirect or not is not particularly relevant. Only article space pages that include the Wikisource1911Enc Citation template should be modified no others. What I asked for was quite specific (see above) and the previous discussion at (Bot_requests :
 * What is needed is to covert Wikisource1911Enc Citation to  for those entries with a parameter and    for those instances of the template without a parameter. If you can handle the instances that include noicon= parameter so much the better, but if not then just exception them and I'll deal with them using AWB.
 * -- PBS (talk) 12:10, 30 April 2011 (UTC)


 * As suggested. I have created the text page User:Petan-Bot/Sandbox08-20 with some examples. -- PBS (talk) 13:59, 30 April 2011 (UTC)
 * I have been through the test list above and I have repaired any that had not already been fixed -- PBS (talk) 21:33, 30 April 2011 (UTC)


 * {{OperatorAssistanceNeeded|D}} Any updates?  MBisanz  talk 00:31, 18 May 2011 (UTC)
 * I am working on that, probably in 4 days. Petrb (talk) 01:47, 18 May 2011 (UTC)
 * {{OperatorAssistanceNeeded|D}} No rush. Just checking in.  MBisanz  {{sup| talk }} 23:16, 12 June 2011 (UTC)

void Init {		TLog(8, "Initialising task #8"); active = true; TLog(8, "OK"); }	int Do {		String^ pt; System::IO::StreamReader^ sw = System::IO::File::OpenText("t8"); String^ page_name = ""; String^ ti = "Converting - {{{Wikisource1911Enc}} - (bot, task)"; Page^ x;		String^ t1; String^ t2; while ( page_name = sw->ReadLine ) {			t1 = ""; x = gcnew DotNetWikiBot::Page(enwiki, page_name); x->Load; if (x->text->Contains("{{Wikisource1911Enc Citation") == true && (page_name != "")) {			pt = x->text; pt = pt->Replace("{{Wikisource1911Enc Citation}}", "{{Cite EB1911|wstitle={{subst:PAGENAME}}}}"); if (System::Text::RegularExpressions::Regex::Match(pt, "\\{\\{Wikisource1911Enc\\sCitation")->Success) {				t1 = System::Text::RegularExpressions::Regex::Match(pt, "\\{\\{Wikisource1911Enc\\sCitation.*\\}\\}")->Value; if (t1 == "") {					break; }				t2 = t1->Replace("Wikisource1911Enc Citation", "Cite EB1911"); if (t2->Contains("wstitle=") != true) {					t2 = t2->Replace("Cite EB1911", "Cite EB1911|wstitle={{subst:PAGENAME}}"); }				pt = pt->Replace(t1, t2); }			try{ x->Save(pt, ti, false); Thread::Sleep(16000); } catch (Exception^ A)			{ Thread::Sleep(20000); try{ x->Save(pt, ti, false); } catch (Exception ^X1) {					Log("T8 Failed: " + page_name); }			}			}		if (x->text->Contains("{{1911") == true && false) {			pt = x->text; pt = pt->Replace("{{1911}}", "{{Cite EB1911|wstitle={{subst:PAGENAME}}}}"); if (System::Text::RegularExpressions::Regex::Match(pt, "\\{\\{1911")->Success) {				t1 = System::Text::RegularExpressions::Regex::Match(pt, "\\{\\{1911.*\\}\\}")->Value; t2 = t1->Replace("1911", "Cite EB1911"); if (t2->Contains("wstitle") != true) {					t2->Replace("Cite EB1911", "Cite EB1911|wstitle{{subst:PAGENAME}}"); }				pt = pt->Replace(t1, t2); }			try{ x->Save(pt, ti, false); Thread::Sleep(16000); } catch (Exception^ A)			{ Thread::Sleep(20000); try{ x->Save(pt, ti, false); } catch (Exception ^X1) {					Log("T8 Failed: " + page_name); }			}			}			delete x;

}		delete sw; return 2; }

in case someone wanted to take over I leave sources of this task, I will fix it probably later if I had time, but anyway I am not sure if this task would get approved though since Kingpin said that it's probably wouldn't be even if it worked (that is main reason why I don't work on it atm) Petrb (talk) 17:17, 30 June 2011 (UTC)
 * {{BotExpired}} Feel free to reopen when you are ready/have the time to finish the request. -- Chris 11:20, 24 July 2011 (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.