User:Polygnotus/DuplicateReferences

This script detects and displays references with duplicate URLs. It also shows a similarity score for the text of the references. Clicking on the reference number highlights it. You can add a Duplicate citations template to the page by clicking the link.



Installation
First install User:Enterprisey/script-installer, then come back to this page and click the giant blue "Install" button in the infobox on the right.

Or install it manually by adding the below code to your Special:MyPage/common.js file:

You can test the script over at User:Polygnotus/dupreftest.

Functionality

 * Displays a list of duplicate URLs in the References section
 * Shows similarity calculation of the text of duplicate references
 * Adds a "add Duplicated citations" link to the References section header (if that template is not present). Clicking on it adds the template to the page (with explanatory editsummary).
 * Highlights the reference you click on, if any, and its duplicates.
 * Highlights the reference number you hover over, if any, and its duplicates.

Limitations

 * Compares the visible text in each reference; not the exact HTML (because that would give incorrect results)