Created
December 31, 2011 04:39
-
-
Save danbeam/1542905 to your computer and use it in GitHub Desktop.
Checks the links of any URL passed to it as an argument.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# Author: Dan Beam <[email protected]> | |
# Requires: Test::WWW::Mechanize (libtest-www-mechanize-perl in apt-get, Test::WWW::Mechanize in CPAN) | |
# Usage: ./check_links.pl 'http://google.com' 'http://yahoo.com' | |
use strict; | |
use warnings; | |
use Test::More tests => 2 * scalar(@ARGV); | |
use Test::WWW::Mechanize; | |
my $mech = Test::WWW::Mechanize->new(); | |
my $urls = " - " . join("\n - ", @ARGV); | |
print "Checking " . scalar(@ARGV) . " URLs:\n" . $urls . "\n"; | |
map { $mech->get_ok($_); $mech->page_links_ok(); } @ARGV; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment