Jump to content

User talk:Polygnotus/Scripts/DeduplicateReferences

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
Latest comment: 4 months ago by Staraction in topic Cite error @ Central Park

testing

[edit]

Where are the testing instructions? rootsmusic (talk) 22:39, 30 December 2025 (UTC)Reply

@Rootsmusic I asked Claude.ai to write a test page for you, see User:Polygnotus/Scripts/DeduplicateReferencesTest. Polygnotus (talk) 17:31, 31 December 2025 (UTC)Reply
Thanks, @Polygnotus. On User:Polygnotus/Scripts/DeduplicateReferences, the blue button says "Uninstall". Step 2 of Instructions for Testing says "Run the DeduplicateReferences script", but I don't see any way to run it.
When I copy the Input in Test Case 1 to my sandbox, the references didn't insert <ref name="firstarticle">.
P.S. I was expecting Instructions for Testing as the first section. rootsmusic (talk) 18:10, 31 December 2025 (UTC)Reply

Feedback

[edit]

I have used User:Polygnotus/DuplicateReferences frequently. It is essential. Another amazing tool by User:Polygnotus. Now I found this to act on the duplicates. Great! Installing today. My only concern is that the dups must be 100%. In practice this is usually not the case so not sure how useful the current script will be as it will leave a lot unrepaired. My wish would be a window that displays the duplicate refs (with opt-in buttons next to each), with an edit box to manually compose the canonical ref. There might be a way to load one of the dups into the canonical box to reduce copy-pasting. Once ready "Run" button and they are converted/merged; the next set of dups is displayed. How it would handle named refs not sure. -- GreenC 17:38, 13 January 2026 (UTC)Reply

@GreenC User:Polygnotus/Scripts/DeduplicateReferences2.js may be of interest to you, it is the new and improved version.
The idea is that this:
<ref>{{cite web|title=x|url=y}}</ref>

<ref>{{cite web|title=x    | url=y      }}</ref>

<ref>{{cite web|url=y|title=x}}</ref>
should turn into:
<ref name="x">{{cite web|title=x|url=y}}</ref>

<ref name="x" />

<ref name="x" />
So it deals with whitespace and parameters in a different order. Still a work in progress tho. Eventually it should know that some parameters are less important (e.g. access-date) and that it can merge refs with different access-dates for example. Polygnotus (talk) 18:02, 13 January 2026 (UTC)Reply
That would automatically get some more which is good. However, the variety of differences are infinite, this work will always require manual input. Need a way to manually intervene that is quick and easy. User:DVRTed/author-link.js is one model (in this case for adding |author-link=). It significantly reduces the friction vs. editing the wikitext. (I'll install version 2). -- GreenC 18:38, 13 January 2026 (UTC)Reply
@GreenC I should probably ask @Nardog: if they would like to add something like this to User:Nardog/RefRenamer. Polygnotus (talk) 23:16, 13 January 2026 (UTC)Reply

Cite error @ Central Park

[edit]

@Polygnotus: thanks for making this tool, it's quite convenient to use. However, when I was running around with it recently I performed an edit that ended up being reverted by @Epicgenius (courtesy ping!) because the edit created a Cite error: The named reference ref was invoked but never defined. In addition to figuring out what ended up causing the bug, is there a way to have the script-assisted edit display in a diff comparison before prompting to submit the edit such that these errors are more easily caught in the future? Thanks, Staraction (talk · contribs) 08:20, 10 April 2026 (UTC)Reply