NAME
WWW::IndexParser - Fetch and parse the directory index from a web server
SYNOPSIS
use WWW::IndexParser;
my @files = WWW::IndexParser->new(url => 'http://www.example.com/dir/');
foreach my $entry (@files) {
printf "%s %s\n", $entry->filename,
scalar(localtime($entry->time)||'');
}
DESCRIPTION
WWW::IndexParser is a module that uses LWP to fetch a URL from a web server. It then atempts to parse this page as if it were an auto generated index page. It returns an array of WWW::IndexParser::Entry objects, one per entry in the directory index that it has found. Each Entry has a set of methods: filename(), time(), size(), and others if supported by the autoindex generated: type() and size_units().
CONSTRUCTOR
- new ( url => $url, timeout => $seconds, proxy => $proxy_url )
-
When called with a URL to examine, this method does not return an object, but an array of WWW::IndexParser::Entry obects, one per entry in the directory listing that was accessed.
The options to this are:
- url
-
The complete URL of the index to fetch.
- timeout
-
The timeout for the request to fetch data, default 10 seconds.
- proxy
-
A proxy server URL, eg, 'http://proxy:3128/'.
METHODS
All methods are private in this module. Pass only a URL to the constructor, and it does everything for you itself.
PREREQUISUTES
This modile depends upon LWP
, HTML::Parser
, Time::Local
.
OSNAMES
any
BUGS
Currently only supports Apache auto index.
AUTHOR
James Bromberger <james@rcpt.to>
COPYRIGHT
Copyright (c) 2005 James Bromberger. All rights reserved. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.