Wikipedia:Bots/Requests for approval/MadmanBot 8
- The following discussion is an archived debate. Please do not modify it. Subsequent comments should be made in a new section. The result of the discussion was Approved.
Operator: Madman
Automatic or Manually assisted: Automatic.
Programming language(s): PHP.
Source code available: Yes.
Function overview: Removing redundant url parameter from citation templates with a pmid parameter
Edit period(s): One-time run.
Estimated number of pages affected: 1000-2000.
Exclusion compliant (Y/N): Yes.
Already has a bot flag (Y/N): Yes.
Function details: The bot first finds all articles with external links to http://www.ncbi.nlm.nih.gov/pubmed/. For each article, it then skips those that link to PubMed and not to a PubMed abstract. It then finds all templates used in the article. For each template, it finds all transclusions used in the text. If the transclusion includes a PMID parameter that has a valid PMID and a URL parameter that links to the PubMed abstract with the same PMID, it removes the URL parameter from the transclusion. It skips links to PubMed abstracts that include a query or fragment, as these are rare edge cases that make it difficult to remove the URL parameter. I've skimmed over a thousand diffs; the bot does exactly what the pmid=|original requestor wanted. — madman bum and angel 17:05, 25 July 2009 (UTC)[reply]
Discussion
[edit]Does this also find URLs like http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=15789284 ? —Chris Capoccia T⁄C 09:08, 29 July 2009 (UTC)[reply]
- It does not; as that format wasn't listed in the bot request, I wasn't aware that was a valid URL. However, once I've completed a run, I can look for additional formats of URLs and run them too, as that would still fall within the scope of this task. Thanks for the information! — madman bum and angel 17:42, 29 July 2009 (UTC)[reply]
It appears to be a useful bot-task as pmid's are unique identifiers, whereas URLs are not necessarily stable. I don't see a lot of community discussion. But the operator is designing the bot in response to a request that is particularly straight-forward. Is there a style manual guideline on using pmid #s? If there is, linking to it in support of this task might be useful. If there isn't there may be a larger community at the style guidelines that may want the bot to do more than this. Still, it looks like a straight-forward bot task. --68.127.233.138 (talk) 04:55, 1 August 2009 (UTC)[reply]
- Approved for trial (30 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. I can't see any complaints forthcoming, but it would still be useful, I'm sure, to present some test edits to those interested. - Jarry1250 [ In the UK? Sign the petition! ] 18:25, 1 August 2009 (UTC)[reply]
- Trial complete. – Thirty edits made with no issues. [1] — madman bum and angel 19:06, 1 August 2009 (UTC)[reply]
- The edits look properly done, removing only the url, leaving the articles cleaner at the end; the linking to the article at pubmed seems better, in my opinion, than the url for a number of reasons.
- Does the bot verify that the pmid parameter and the pmid in the url that is deleted are the same? --68.127.233.138 (talk)
- Indeed it does; per the function details, the criteria are "if the transclusion includes a PMID parameter that has a valid PMID and a URL parameter that links to the PubMed abstract with the same PMID". Cheers! :) — madman bum and angel 05:21, 2 August 2009 (UTC)[reply]
- Thanks. Probably was no need to worry. --68.127.233.138 (talk) 18:44, 2 August 2009 (UTC)[reply]
- Indeed it does; per the function details, the criteria are "if the transclusion includes a PMID parameter that has a valid PMID and a URL parameter that links to the PubMed abstract with the same PMID". Cheers! :) — madman bum and angel 05:21, 2 August 2009 (UTC)[reply]
- Trial complete. – Thirty edits made with no issues. [1] — madman bum and angel 19:06, 1 August 2009 (UTC)[reply]
- The above discussion is preserved as an archive of the debate. Please do not modify it. Subsequent comments should be made in a new section.