Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#!/bin/bash
find YOURPATH -name \*.html | xargs grep href | perl -ne \
'chomp;
@match=split(/:/);
$match[0]=~s/[^\/]*$//;
$foo=join(":",@match[1,-1]);
$foo=~s/^.*href="//;
$foo=~s/".*$//;
if(substr($foo,0,6) ne "mailto")
{
if(substr($foo,0,4) eq "http") { $url=$foo; }
else {
if(substr($foo,0,1) eq "/") {
$url="http://YOURSITE.com".$foo;
} else {
$url="http://YOURSITE.com/".$match[0].$foo;
}
}
$status=`curl --head --silent "$url" | head -1`;
$status=~s/^.*?([0-9]{3}).*$/\1/;
chomp($status);
print $status." -- ".$url."\n";
}' | grep -v "^200"
405 -- [url]http://us.imdb.com/Title?0066473[/url]
405 -- [url]http://us.imdb.com/Title?0120885[/url]
302 -- [url]http://www.dictionary.com/cgi-bin/dict.pl?term=apotropaic[/url]
302 -- [url]http://www.dictionary.com/cgi-bin/dict.pl?term=boustrophedonically[/url]
...
HorsePunchKid said:By "validate the links", do you mean run an HTML validator on each of the things that are linked to, or do you want to verify that each of the links points somewhere that won't give you a 404?
I'm on Windows XP, but you don't see me not using Cygwin.rodsfree said:HPKid...thanks for the code!!!.....but I'm on server 2003 instead of linux.