WWW::IndexParser(3pm)

WWW::IndexParser3pm

Fetch and parse the directory index from a web server

Usage

 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)||'');
 }

Overview

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, debug => 1 )

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/'.

debug

Decide if to print parsing debug information. Set to 0 (the default) to disable, or anything non-false to print. Recommended you use a digit (ie, 1) as this may become a numeric 'level' of debug in the future.

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

Releases

10 releases since Debian 4.0 (Etch); the text changed 3 times.

  1. 4.0
  2. 5.0–8
  3. 9–11
  4. 12–13

Bugs

Currently only supports Apache, IIS and Tomcat style auto indexes. Send suggestions for new Auto-Indexes to support to the author (along with sample HTML)!

Author

James Bromberger <[email protected]>

From libwww-indexparser-perl 0.91-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.