Skip to content

Check link report

August 10, 2012

There is a program called checklink which validates web sites. I use the client like so:

checklink -b -l site.com site.com > output.txt

However, I find that it is very verbose and difficult to swim through the output. So, I wrote a report generator for the report maker.

#! perl
@twolines=();
while (<>) {
    $checked = $1 if /Processing\s+(.*)/;
    print "in ", $checked," broken link\n\t",@twolines if /404/;
    push(@twolines, $_);
    shift(@twolines) if @twolines > 2;
}

This only reports 404 errors. It is not robust, but makes the checklink report easier to read.

Advertisements

From → Technology

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: