Wikipedia:Bots/Requests for approval/BogBot 5
[[User:BogBot|BogBot 5]]
{{Newbot|BogBot|5}}
Operator: {{botop|Boghog}}
Time filed: 22:10, Saturday April 5, 2014 (UTC)
Automatic, Supervised, or Manual: Supervised
Programming language(s): Python
Source code available: User:BogBot/Source_code/Task_05
Function overview:
For the 1500 most accessed WP:MED articles, replace transcluded {{tl|cite pmid}}, {{tl|cite doi}}, and {{tl|cite isbn}} templates with in-line {{tl|cite journal}} and {{tl|cite book}} templates respectively. In addition, replace vertically formatted templates (template on many lines) with horizontally formatted templates (template on one line).
Links to relevant discussions (where appropriate):
Edit period(s): A one time run for now. May be run periodically in the future for maintenance.
Estimated number of pages affected: maximum 1500
Exclusion compliant (Yes/No): Yes
Already has a bot flag (Yes/No): Yes
Function details:
In order to respect WP:CITEVAR, the bot will substitute transcluded cite templates with in-line templates only if in-line templates predominate in the current version of the article. The bot will also keep track of which articles were not substituted for possible human follow-up (i.e., only substitute if there is consensus on the article's talk page for these edits). Likewise, the bot will replace vertical cite templates with horizontal templates only if horizontal templates templates predominate. In addition, the bot will determine the predominate author format ("author" vs "authors" vs "first1, last1, first2, last2") and the substituted template will follow that style.
A example bot edit is shown [https://en.wikipedia.org/w/index.php?title=User%3ABoghog%2FSandbox9&diff=603479485&oldid=603474917 here].
Additional notes:
- The bot extracts passthrough parameters from {{tl|cite pmid}} and {{tl|cite doi}} templates (and also default parameters if the corresponding passthrough parameters are missing) and adds them to the substituted template. (see example [https://en.wikipedia.org/w/index.php?title=User%3ABoghog%2FSandbox8&diff=602300110&oldid=602297377 diff].)
- If a citation contains a doi without a pmid, the bot will query the PubMed database with the doi to obtain a pmid. If the pmid is returned by the search, the bot will add it to the citation.
=Discussion=
From your {{diff|User:Boghog/Sandbox9|603479485|603474917|example}}:
Seven authors in {{para|author}}, why {{para|display-authors|1}} in this citation?
:
:→{{cite journal | author = Barker LF, Shulman NR, Murray R, Hirschman RJ, Ratner F, Diefenbach WC, Geller HM | title = Transmission of serum hepatitis. 1970 | journal = Journal of the American Medical Association | volume = 276 | issue = 10 | pages = 841–844 | year = 1996 | pmid = 8769597 | doi = 10.1001/jama.276.10.841 | display-authors = 1 |no-tracking=true}}
Twenty authors in {{para|author}}, why {{para|display-authors|8}} in this citation?
:
::→{{cite journal | author = Yan H, Zhong G, Xu G, He W, Jing Z, Gao Z, Huang Y, Qi Y, Peng B, Wang H, Fu L, Song M, Chen P, Gao W, Ren B, Sun Y, Cai T, Feng X, Sui J, Li W | title = Sodium taurocholate cotransporting polypeptide is a functional receptor for human hepatitis B and D virus | journal = eLife | volume = 1 | pages = e00049 | year = 2012 | pmid = 23150796 | pmc = 3485615 | doi = 10.7554/eLife.00049 | display-authors = 8 |no-tracking=true | doi-access = free }}
—Trappist the monk (talk) 20:35, 9 April 2014 (UTC)
:: Those displayauthor parameters were added by various editors to the cite doi templates (see [https://en.wikipedia.org/w/index.php?title=Template:Cite_doi/10.1001.2Fjama.276.10.841&diff=next&oldid=415114324 diff] and [https://en.wikipedia.org/w/index.php?title=Template%3ACite_doi%2F10.7554.2FeLife.00049&diff=557246720&oldid=536529885 diff]). I agree that it is probably not a good idea to propagate the displayauthor parameter, particularly if the parameter is set to a low number. Hence I have modified the bot script not to include that parameter in the substituted template unless displayauthors was set as a passthrough parameter in that specific article. Boghog (talk) 04:38, 10 April 2014 (UTC)
{{BotTrial|edits=50}} --slakr\ talk / 07:23, 12 April 2014 (UTC)
:[https://en.wikipedia.org/w/index.php?title=Bipolar_disorder&curid=4531&diff=603896185&oldid=603893399 This edit] looks buggy. No harm was done, but the edit summary is incorrect and I can't explain the logic. It was reported on User talk:Boghog but should have been reported here. – Jonesey95 (talk) 03:54, 13 April 2014 (UTC)
:: I have responded on my talk page and modified the bot script accordingly. I just wanted to note here that particular edit was an accidental rerun of the bot. Boghog (talk) 09:40, 13 April 2014 (UTC)
This is wonderful. I am so looking forwards to no longer having to correct all this refs by hand :-) What a huge step forwards. Doc James (talk · contribs · email) (if I write on your page reply on mine) 19:39, 21 April 2014 (UTC)
Please clarify the point about converting templates with parameters arranged vertically to parameters arranged horizontally. Is this just for the template instances you need to modify for some other reason, or all cite xxx templates in the article? If the latter, prove the user community has expressed consensus for this change. Jc3s5h (talk) 14:27, 8 May 2014 (UTC)
: There was also consensus to change from vertical to horizontal format. Boghog (talk) 05:23, 26 May 2014 (UTC)
: Please respond to {{U|Jc3s5h}}'s request... We need to not leave dangling BRFAs. Hasteur (talk) 00:10, 26 May 2014 (UTC)
::Here was the discussion with the consensus [https://en.wikipedia.org/wiki/Wikipedia_talk:WikiProject_Medicine/Archive_47#Should_we_change_the_ref_layout_during_the_above_bot_work.3F] Doc James (talk · contribs · email) (if I write on your page reply on mine) 05:23, 26 May 2014 (UTC)
{{BotWithdrawn}} – there were only about 300 pages that needed to be edited. Furthermore, there were a lot of special cases that were difficult to code for in the bot script. Hence I have completed editing the 300 pages manually checking each and every edit before committing. Boghog (talk) 16:14, 8 June 2014 (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.