Project

deadfinder

0.05
The project is in a healthy, maintained state
Find dead-links (broken links). Dead link (broken link) means a link within a web page that cannot be connected. These links can have a negative impact to SEO and Security. This tool makes it easy to identify and modify.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.8.0
~> 2.6.0
~> 1.13.0
~> 0.2.0
~> 1.0.0
~> 1.2.0
 Project Readme

DeadFinder

Dead link (broken link) means a link within a web page that cannot be connected. These links can have a negative impact to SEO and Security. This tool makes it easy to identify and modify.

Installation

Install with Gem

gem install deadfinder

# https://rubygems.org/gems/deadfinder

Install with Homebrew

brew install deadfinder

# https://formulae.brew.sh/formula/deadfinder

Docker Image

docker pull ghcr.io/hahwul/deadfinder:latest

Using In

CLI

deadfinder sitemap https://www.hahwul.com/sitemap.xml

Github Action

steps:
- name: Run DeadFinder
  uses: hahwul/deadfinder@1.3.4
  id: broken-link
  with:
    command: sitemap
    target: https://www.hahwul.com/sitemap.xml

- name: Output Handling
  run: echo '${{ steps.broken-link.outputs.output }}'

Ruby Code

require 'deadfinder'

app = DeadFinderRunner.new
options = {}
options['concurrency'] = 30

app.run('https://www.hahwul.com/2022/09/30/deadfinder/', options)
puts Output

Usage

Commands:
  deadfinder file <FILE>            # Scan the URLs from File. (e.g deadfinder file urls.txt)
  deadfinder help [COMMAND]         # Describe available commands or one specific command
  deadfinder pipe                   # Scan the URLs from STDIN. (e.g cat urls.txt | deadfinder pipe)
  deadfinder sitemap <SITEMAP-URL>  # Scan the URLs from sitemap.
  deadfinder url <URL>              # Scan the Single URL.
  deadfinder version                # Show version.

Options:
  c, [--concurrency=N]          # Number of concurrncy
                                # Default: 20
  t, [--timeout=N]              # Timeout in seconds
                                # Default: 10
  o, [--output=OUTPUT]          # File to write JSON result
  H, [--headers=one two three]  # Custom HTTP headers to send with request

Modes

# Scan the URLs from STDIN (multiple URLs)
cat urls.txt | deadfinder pipe

# Scan the URLs from File. (multiple URLs)
deadfinder file urls.txt

# Scan the Single URL.
deadfinder url https://www.hahwul.com

# Scan the URLs from sitemap. (multiple URLs)
deadfinder sitemap https://www.hahwul.com/sitemap.xml

JSON Handling

deadfinder sitemap https://www.hahwul.com/sitemap.xml \
  -o output.json
  
cat output.json | jq
{
  "Origin URL": [
    "DeadLink URL",
    "DeadLink URL",
    "DeadLink URL"
  ]
}