1. 背景

やっぱり、デッドリンクはなくしておきたいです。

2. 手順

docker run --rm -v $(pwd):/data cytopia/linkcheck .

以下はヘルプの内容。

-e        Limit search to those file extensions.
          Defaults to limiting on non-binary files.
          Accepts comma separated string of extensions:
            -e txt
            -e txt,rst
            -e sh,py.c,h

-i        Ignore all URLs matching the specified regex.
          Defaults to: ^http(s)?:\/\/(127\.0\.0\.1)|(localhost).*$
          Accepts a single regex string:
            -i '^http(?):\/\/my-comapny.com.*$'

-t        Specify curl timeout in seconds, after which probing stops for one url.
          Defaults to 10 seconds.
          Accepts a positive integer:
            -t 5
            -t 10

-r        Specify how many time to retry probing a single URL, before giving up.
          Defaults to 3 times.
          Accepts a positive integer:
            -r 5
            -r 10

-c        Specify HTTP status codes that are valid for success.
          Any code not specified in here will produce an error for the given URL.
          Defaults to '200'.
          Accepts comma separated string of http status codes:
            -c '200'
            -c '200,301'
            -c '200,301,302'

-k        Ignore invalid SSL certificates for HTTPS connections.
          This argument does not accept any parameters.
          Defaults to error on invalid SSL certificates.

-l        Specify whether to follow redirect URLs or not.
          This argument does not accept any parameters.
          Defaults to not following redirects.

-v        Be verbose and also show affected files.

--version Show version and exit.
--help    Show this help screen.

3. 補足

アメブロの記事リンクをgrepで調べる。

grep -hoE https://ameblo.jp/baliclub/entry-[0-9]{11}.html . -r