#! /usr/bin/perl -w
#
# simtelrc.pl
# Copyright 1999 by Richard Dawe
#
# Make a list of Simtelnet FTP mirror sites for zippo

# Download the list of mirrors from here:
$URL     = 'http://mic5.hensa.ac.uk/simtel.net/mirrors.html';
# Or, better still, from the central site
# $URL    = 'http://www.simtel.net/simtel.net/mirrors.html';

$MATCHPAT    = "\"<A HREF=\"";
$MIRROR_LIST = `wget -q -O - $URL | grep $MATCHPAT`;
@MIRRORS     = split(/[\n\r]/, $MIRROR_LIST);
@MIRRORS     = sort(@MIRRORS);

foreach $mirror (@MIRRORS) {
	$mirror =~ s/^(.*)(<A HREF=")(.+)(">.+)$/$3/;
	print $mirror."\n";
}
