Why not adopt me?
NAME
HTTP::SimpleLinkChecker - Check the HTTP response code for a link
SYNOPSIS
use HTTP::SimpleLinkChecker;
my $code = HTTP::SimpleLinkChecker::check_link($url);
unless( defined $code )
{
print "Error: $HTTP::SimpleLinkChecker::ERROR\n";
}
DESCRIPTION
You don't have to know anything about objected-oriented Perl, LWP, or the HTTP module to be able to check your links. This module is designed for the casual user. It has one function, check_link
, that returns the HTTP response code that it receives when it tries to fetch the web address passed to it. The undef value is returned for any non-HTTP failure and the $HTTP::SimpleLinkChecker::ERROR
variable is set.
The HEAD method is tried first, although if anything other than a good status code (those less than 400) is received, another request is made with the GET method.
If you are behind a firewall or proxy, this module picks up those settings through LWP::UserAgent's env_proxy() method. See LWP::UserAgent for more details.
Functions
- check_link( URL )
-
Return the HTTP response code for URL.
- user_agent
-
Returns a reference to the LWP::UserAgent object. You can affect it directly. See LWP::UserAgent.
my $ua = HTTP::SimpleLinkChecker::user_agent; $ua->from( 'joe@example.com' ); $ua->agent( 'Mozilla 19.2' );
SOURCE AVAILABILITY
This source is part of a SourceForge project which always has the latest sources in CVS, as well as all of the previous releases.
http://sourceforge.net/projects/brian-d-foy/
If, for some reason, I disappear from the world, one of the other members of the project can shepherd this module appropriately.
AUTHOR
brian d foy, <bdfoy@cpan.org>
COPYRIGHT
Copyright (c) 2004-2005 brian d foy. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.