add quick script to list links in pages to check them. - www.codemadness.org - www.codemadness.org saait content files
 (HTM) git clone git://git.codemadness.org/www.codemadness.org
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 40333727ed4ea6f1bc178b1ef505e0eae8334ec8
 (DIR) parent 125addf05c466f16e51dfd1392bb766425e9a59f
 (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
       Date:   Sat,  3 Jul 2021 16:13:08 +0200
       
       add quick script to list links in pages to check them.
       
       Diffstat:
         A scripts/checklinks.sh               |      24 ++++++++++++++++++++++++
       
       1 file changed, 24 insertions(+), 0 deletions(-)
       ---
 (DIR) diff --git a/scripts/checklinks.sh b/scripts/checklinks.sh
       @@ -0,0 +1,24 @@
       +#!/bin/sh
       +# list unique links.
       +
       +tmp=$(mktemp)
       +for h in output/*.html; do
       +        webdump -x -b "http://codemadness.org/" < "$h" 3>"$tmp" >/dev/null
       +        cat "$tmp"
       +done | \
       +awk -F '\t' '
       +# ignore these links.
       +$2 ~ /codemadness\.(org|nl)/ ||
       +$2 ~ /youtube\.com/ ||
       +$2 ~ /man\.openbsd.org/ {
       +        next;
       +}
       +{
       +        link = $2;
       +        gsub("#.*$", "", link); # remove fragment.
       +        
       +        if (!links[link]) {
       +                print $1 "\t" $2;
       +                links[link] = 1;
       +        }
       +}'