Jump to content

Dead Link Checker

From Meta, a Wikimedia project coordination wiki

Introduction

[edit]

External links are frequently utilized as references on Wikipedia pages, serving as a means of verifying the information on a given page. It is crucial that these links are functional; otherwise, verifying information becomes challenging. To curb this problem Wiki Movement Brazil has created a tool that automates checking of external links on Wikipedia and marks those whose http status is not 200 as part of addressing the Lusophone technological wishlist proposals.

Installation

[edit]

To add the script to your Wikipedia account, add the following line of code to the Javascript page of your skin:

mw.loader.load("https://deadlinkchecker.toolforge.org/static/script.js")

Functionality

[edit]

Once the tool is loaded to your Javascript page, a check links option will appear in your tools menu - on the right hand side of your wikipedia page. Click on it to start checking the links on the page.

When the script has started checking links on a page, a dialog with a loading spinner and a message checking page... shows up on the bottom right of the page.

If a page has more than 50 external links, The tool checks them in batches of 50 and marks the dead links found in each of the batches. The dialog is also updated with the dead links found after each batch.

When the script has finished checking the page and has found some dead links, it will mark the links whose status code is not 200 with an icon and a message from the server. The number of broken links found on the page will also be displayed in the dialog at the bottom right other wise the message ok and an OK icon will be displayed. Click the top right cancel icon in the dialog box to clear it.

To stop the script from checking links, click stop Link checker in the tools menu.

[edit]

When a dead link is found on a page it will be marked with a danger icon and either one of the following messages:

  • Bad Request: It happens when a request sent to the link is malformed or invalid. The link may or may not be dead. Either way, its marked for verification.
  • Forbidden: This happens when a server has been denied access to a resource. Its a permission issue. The script tries to circumvent this by using a user agent but it could still show up for some of the links. The link may or may not be dead and will need to be verified manually.
  • Not Found: It happens when the resource could not be found on the server or was moved. In this case the link is confirmed dead.
  • Unable to connect: This implies the server completely failed to establish a connection to the resource and is a high indicator the link is broken or dead.
  • Unknown Error: The script captures errors in the 400-500 range so status codes that fall outside that range will be marked with this message.

Languages

[edit]

The script currently supports three languages; English, Portuguese and German with English being the default language. Other languages will be added with time. To add another language, you can do so on the script's GitHub page.

Source code

[edit]

The source code for this script is currently available on GitHub under the GNU General Public License v3.0. Report any issues encountered when using the script on GitHub.