User talk:Ucucha/duplinks

Exceptions
I'm pointing Milhist people here so that we can discuss exceptions, that is, any duplicate links that you'd prefer to retain.
 * Would anyone prefer that the tool only remove links that are, say, within 2 screens of a duplicate link in the main text? My sense is that this could go either way, that people aren't fussy about whether they prefer no duplicate links at all, or none "nearby". - Dank (push to talk) 17:30, 10 October 2011 (UTC)
 * That would be quite hard to implement (not least because "2 screens" can have a very different meaning depending on your screen size). I think it would be more useful to show the links and let the user decide whether the second link is justified. Ucucha (talk) 21:02, 10 October 2011 (UTC)
 * [Copied from WT:FAC, and seconded at WT:MIL:] Could you (maybe optional) exclude file captions, templates, tables and references (named and unnamed) as well please? Additional links in those "special areas" seem to be generally accepted. Many thanks for that nice tool. GermanJoe (talk) 12:11, 10 October 2011 (UTC)
 * I think I'll make it so that it only checks links within actual paragraphs and lists, and ignores stuff like figure captions. Ucucha (talk) 21:02, 10 October 2011 (UTC)
 * This is now done. Let me know how it works and whether there are additional categories of links that should be excluded (or that should be included). Ucucha (talk) 20:11, 13 November 2011 (UTC)

Bug? Tool link not showing on article
For some reason, when I open Demographics of Croatia, the link for this tool doesn't appear in the sidebar, although it does appear for other articles. --Stfg (talk) 11:21, 24 November 2011 (UTC)
 * The link does appear there for me, and shows that Orthodox Christianity is linked twice in the lead. Possibly it's a caching issue on your end; have you tried clearing your browser cache? Ucucha (talk) 13:08, 24 November 2011 (UTC)
 * Thanks. Yes, that article is very overlinked. Clearing the cache hasn't helped, but I've discovered something else about the offending page, which almost certainly proves that the bug isn't in duplinks, so I've asked at WP:VPT for it to be looked at. Apologies for the distraction. Best, --Stfg (talk) 14:47, 24 November 2011 (UTC)

Overlinking
I installed the script. However while the duplicate links are highlighted, the over-linked terms are not. I think that perhaps i am not doing something to get that done. Would someone mind explaining what i must do to get the over-linked terms highlighted? Joyson Prabhu Holla at me!  09:21, 16 December 2011 (UTC)
 * You mean the first occurrences of links that are linked multiple times? The script is not currently highlighting those; do you think that would be useful to do? Ucucha (talk) 10:37, 16 December 2011 (UTC)
 * OK! It just highlights duplicate links. Sorry! Joyson Prabhu  Holla at me!  10:42, 16 December 2011 (UTC)

Humorology
I'm getting the tool to work on other pages, but I can't seem to get it to work on Humorology, any ideas?
 * It appears that if a link is in a dotted list, that the code doesn't register it has having been existed. For example, if a file consists of

foo then no duplicates come up and
 * foo

foo foo
 * foo

the only the last link to foo is counted as a duplicate, not the second one.Naraht (talk) 18:01, 14 May 2012 (UTC)
 * It ignores all links in lists, because in such cases duplicate links are usually not considered a problem. Ucucha (talk) 18:10, 14 May 2012 (UTC)
 * OK, I can see now in the description that Lists wouldn't be covered. So does that equally mean that links in a table would be ignored as well?
 * Yes. Ucucha (talk) 17:36, 16 May 2012 (UTC)

Another page loading problem
Hi Ucucha. I've just created WP:VPT which involves page loading errors with duplinks not appearing in the sidebar. Last time it wasn't duplinks's fault, but I thought you'd want to know, especially as duplinks didn't appear at the side of VPT, which showed no page loading error. Rgds, --Stfg (talk) 16:21, 16 May 2012 (UTC)

Script not working
It is located at User:Piotrus/common.js, and does nothing when I click it. I tried several pages and two browsers. I'd wager a guess that something messes up it links to execute it (so for example at Great Sejm, it is http://en.wikipedia.org/wiki/Great_Sejm#). Could it clash with something at User:Piotrus/vector.js? --Piotr Konieczny aka Prokonsul Piotrus&#124; talk to me 23:17, 29 May 2012 (UTC)
 * The script's results are not very visually prominent, so you may have missed it. When I run the script on that page, it highlights several links in the "1789–90" section in red. Otherwise, are you seeing anything in your JavaScript error console (WP:JSERROR point 6)? Ucucha (talk) 18:53, 30 May 2012 (UTC)
 * Bah, you are right, I am blind. You may want to add some (click-away?) message appearing, perhaps something that will report the total number of dupe links found for added usefulness? --Piotr Konieczny aka Prokonsul Piotrus&#124; talk to me 00:13, 31 May 2012 (UTC)

Script not working - again
Hey, it's me. This time I am 100% sure this is not me being blind. Ex. in Tadeusz Kościuszko I try clicking on "Highlight..." link. I try to use it in Firefox and Chrome, nothing happens. Chrome Java Consol reports nothing. Could it be clashing with WikiEd? --Piotr Konieczny aka Prokonsul Piotrus&#124; reply here 09:52, 18 May 2013 (UTC)
 * For me, it reports lots of duplicate links starting in the "Early life" section. Not sure what should cause it to behave differently for you; I also have wikEd turned on. Ucucha (talk) 11:00, 18 May 2013 (UTC)

Request
Can this script highlight the first link, say with a green box? As it is, it only highlights what it determines to be a duplicate. However on longer articles, it may actually be a good idea to relink subsequent mentions in a different section. I'm thinking of Interstate 75 in Michigan, where a lot of the same intersecting highways and locations will be mentioned again in the "History" section after being mentioned in the "Route description". The RD on that is quite long (As it should be for the longest highway in the state), and a new mention of something in the History could be screens away from the first link in the RD, warranting a relink. However, that means many links in the History are "duplicates" and highlighted, but it makes it hard to see if I duplicated links within the History, or between the RD and the History. Also, the instructions aren't clear that the script doesn't highlight the first link, only the second (and third...) ones.  Imzadi 1979  →   20:17, 14 August 2013 (UTC)
 * I've coded an alternate version of the script that will highlight the first occurrence of a duplicated link in a green box - see User:Evad37/duplinks-alt - Evad37 (talk) 09:14, 19 August 2013 (UTC)
 * Thanks!  Imzadi 1979  →   09:20, 19 August 2013 (UTC)

Thank you
Just a note to say how helpful your clever invention is, and how very pleased I am to have it.  Tim riley  talk    15:18, 12 September 2014 (UTC)

Request for functionality in Draft: namespace
Would you consider extending this very useful tool to work in the draft namespace (118 if there's not a handy constant like Namespace.DRAFT)? It would be a boon to those of us working on whipping drafts by novice editors into shape for the main article space. Worldbruce (talk) 04:38, 13 September 2014 (UTC)

Added one sentence.
Hello Ucucha! I added one sentence to this documentation page. Believe it or not, some of us out there (me) could not get your script to work simply because we didn't know we were supposed to be in Edit mode, previewing the edit, and looking for a link outlined in red. I have never touched anyone else's page until today, so feel free to revert me, but perhaps this will help some. :-) Cheers. Prhartcom (talk) 17:17, 7 November 2014 (UTC)

Expansion/offshoot suggestion
I use this tool all the time now, and it's so useful I have a feature-request/possible-offshoot suggestion.

One thing I'm using quite a bit is the convert tag. Like links, this should only be provided for the first instance of any given measure. So something like...

The radar had a range of about 10,000 feet (3,000 metres). Beyond 10,000 feet, you shouldn't use the convert again.

I think I would use a tool to check for these duplications quite a bit, but that's because I do a lot of work in technical articles.

Anyway, thanks again! Maury Markowitz (talk) 23:24, 7 December 2014 (UTC)

Feature Suggestion
It would be very helpful if for the first instance of duplicated links, it were bordered in green. DinoD123 (talk) 22:57, 26 January 2015 (UTC)
 * My script, User:Evad37/duplinks-alt, does exactly that - Evad37 &#91;talk] 00:50, 27 January 2015 (UTC)

Doesn't work
When I click on "Highlight duplicate links" nothing happens. Google Chrome Version 43.0.2357.65 m (64-bit) using HTTPS Everywhere. --DrSeehas (talk) 22:39, 20 May 2015 (UTC)
 * Same. Chrome/OS X Handpolk (talk) 00:15, 24 June 2015 (UTC)

Three issues
When I highlight in preview mode in S.L. Benfica, the whole lead appears highlighted and, if I scroll down, I see duplicate links for citation needed span and Football squad start. SLBedit (talk) 06:33, 28 June 2015 (UTC)

Not working
Hi, I want to prune out the duplicates at WikiProject Women in Red/Metrics. I copied the page into my sandbox, but the Highlight duplicate links button isn't showing anything with a red box. Although I'm pretty sure there are duplicates, I purposefully created a duplicate entry to test the bot, but still nothing is showing up with a red box. Help? --Rosiestep (talk) 14:39, 2 August 2015 (UTC)
 * The script only checks for duplicate links in prose sections (paragraphs), and will ignore lists (such as the July metrics), tables, image captions, etc. - Evad37 &#91;talk] 06:27, 3 August 2015 (UTC)
 * Ok, that answers that. Thank you! --Rosiestep (talk) 14:36, 3 August 2015 (UTC)

How do you tell
I put the code in, and for about a period of time I couldn't figure out what was highlighted whether in edit source or edit visual. I even tried to look at links that were obviously duplicated throughout the page but it wouldn't highlight. Can someone explain what the highlight usually looks like and how to spot a duplicate with it? I'm just dumbfound about it.  A dog 104  Talk to me 20:16, 12 December 2015 (UTC)
 * Duplicated links appear inside a red-lined rectangle. SLBedit (talk) 18:26, 29 December 2015 (UTC)

See also sections
Won't it be nice if it covered these sections as well? Ugog Nizdast (talk) 07:10, 15 December 2016 (UTC)

Deprecation of global config variables
I don't think the script is actually broken yet, but  should be referred to as. --SoledadKabocha (talk) 23:49, 18 January 2017 (UTC)

intended MOS:DUPLINK
Since MOS:DUPLINK allows duplicate links in some cases, should there be a way to indicate that a link is a known duplicate, such that your search should ignore it? (And also a special search for such links, so one can check of overusing them.) Gah4 (talk) 21:07, 21 February 2017 (UTC)

Script counting links in lead
G'day, I just ran the script on 250t-class torpedo boat and it is counting links in the lead, giving false duplinks results. Cheers, Peacemaker67 (click to talk to me) 01:59, 6 June 2017 (UTC)
 * Fixed in my alternate version User:Evad37/duplinks-alt, which also highlights the first occurrence of a repeated link in green. (Here's the diff, the same fix should also work here.) - Evad37 &#91;talk] 04:00, 6 June 2017 (UTC)
 * Nice one, thanks. Peacemaker67 (click to talk to me) 04:11, 6 June 2017 (UTC)

Not working
I do not get any highlighting when I use this script. I have it pasted to my special page and see the link on the left but nothing changes when I click it. What am I doing wrong? Andrew Z. Colvin • Talk 23:12, 24 May 2018 (UTC)

Nevermind. I did not know it had to be in visual editing mode. Andrew Z. Colvin • Talk 23:26, 24 May 2018 (UTC)

Two things I've noticed
While using the duplinks tool, I have noticed that it does not recognise duplicate links if they are redirects, and (at least for me), it includes image captions instead of just article prose. Is there a solution to either of these issues?

Much appreciated, ▼PσlєοGєєк  ƧɊƲΔƦΣƉ▼  21:33, 21 November 2018 (UTC)
 * I'll ping, who made the revised version of the script that we use, I don't think the original operator is active anymore. FunkMonk (talk) 10:19, 22 November 2018 (UTC)


 * (Sorry for the late reply.) Handling redirects is complicated. As well as not showing their target pages in the HTML source of the page (which is what the script looks at to find duplicate links), you also have to account for redirects targeting different sections of the same page. So the script would really need to be rebuilt to account for redirects.
 * With regards to captions, my version of the script (User:Evad37/duplinks-alt) seems to be working alright. - Evad37 &#91;talk] 00:13, 24 January 2019 (UTC)
 * Yes, I have no problem with captions either. FunkMonk (talk) 08:26, 24 January 2019 (UTC)

Citation needed ought to be excluded
This tool ought not to pick up any recurrent use of the cn template. —Hugh (talk) 21:58, 23 January 2019 (UTC)
 * My version of the script (User:Evad37/duplinks-alt) handles these correctly. Perhaps its time to redirect Ucucha's script to mine, given the similarity between the two scripts and all the problems this version has. - Evad37 &#91;talk] 00:18, 24 January 2019 (UTC)

Case sensitivity
When using this tool, I notice that it doesn't highlight duplicate links that start with different letter cases. Is it possible to fix this bug? Jarble (talk) 18:06, 21 October 2020 (UTC)
 * If this bug hasn't been fixed yet, then it should be possible to convert the titles to lower-case using String.prototype.toLowerCase on the first character of the page title. Jarble (talk) 18:10, 21 October 2020 (UTC)


 * User:Evad37 has taken over maintenance of this script (the script page now redirects to their version), so I suggest you contact them to fix this issue. Ucucha (talk) 12:58, 22 October 2020 (UTC)