Skip to content
Link checker
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


gem_version.png gem_downloads.png travis.png code_climate.png

Link checker for BBC News & World Services sites.

The idea is to quickly check a page for broken links by doing a status check on all the relative URL's on the page.

There are 4 parts to this tool, the URL, the base URL, the regex and the filename.

  • URL is the page that you want to check for broken links, e.g
  • Base URL is used with the relative URL from the regex to create a full URL, e.g
  • Regex is the point of the URL that you want to keep from the regex, e.g, specifying /news would create /news/uk.
  • Filename is markdown (.md) file where all the page links are stored, this can be useful for manual checks, e.g


gem install linkey


Command Line

linkey check <url> <base_url> <regex> <filename>


linkey check /arabic
linkey check /technology


Once running, you'll see either a 200 with Status is 200 for <URL> or Status is NOT GOOD for <URL>.

Script It

require 'linkey'

url = ''
base = ''
reg = '/arabic'
filename = ''

page =, filename)
status =, base, reg, filename)


From a File

If you have a lot of URLs that you want to check all the time using from a file is an alternative option. This will utilise the smoke option, then point to a YAML file with the extension. In some situations, we are deploying applications that we don't want public facing, so ensuring they 404 is essential. There is a status code option to allow a specific status code to be set against a group of URL's, ensuring builds fail if the right code conditions are met.

linkey smoke test.yaml

Example YAML Config:

base: ''

concurrency: 100

   X-content-override: ''

status_code: 200

  - /news
  - /news/uk

Via a Ruby script:

require 'linkey'

tests ="path/to.yaml")
You can’t perform that action at this time.