Article 5362 of comp.infosystems.gopher:
Xref: feenix.metronet.com comp.infosystems.gopher:5362
Newsgroups: comp.infosystems.gopher
Path: feenix.metronet.com!news.utdallas.edu!convex!convex!cs.utexas.edu!uunet!caen!uvaarpa!liberty!doylej
From: [email protected] (John Doyle)
Subject: Re: Getting Gopher links
Message-ID: <[email protected]>
Date: Sat, 18 Sep 1993 03:01:59 GMT
References: <[email protected]>
Organization: Washington & Lee University
X-Newsreader: TIN [version 1.1 PL8]
Lines: 57

[email protected] wrote:

:       Isn't there just a .links file somewhere that one could get
: via FTP or Gopher or WAIS with this data in it?

There is a single file listing all the public gopher servers at
liberty.uc.wlu.edu (either FTP /pub/lawlib/veronica.gopher.sites  or  via
Gopher at 0/liberty/law/lawftp/veronica.gopher.sites).  It is not in
gopher format though, if interested you would need to convert it.  Below is
a simple Perl script that will do that.  You would end up with a single link
file of over 2200 servers, so it would be a bit unwieldy unless you want
to make some modification to the script to split the output.

John Doyle.  Washington & Lee University.  [email protected]

--------------------------------------------------------------------

#!/usr/bin/perl
#
# gophersites.pl  copies gopher site data maintained in a single file ($INFILE)
#                 and outputs it to $OUTFILE in gopher format
#

$INFILE  = "veronica.gopher.sites";
$OUTFILE = ".gopherlinks";

open(IN,"veronica.gopher.sites") || die "no $INFILE\n";
open(OUT,"> $OUTFILE") || die "cannot open $OUTFILE\n";
while(<IN>)
{
 $firstchar = substr($_,0,1);
 if (($firstchar eq "#")  ||  # comment
     ($firstchar eq "}")  ||  # probably bad
     ($firstchar eq "~"))     # definitely  bad
 {next;}

 chop;
 if ($firstchar eq "|") { $_ =~ s/^\|+//;}  # delete failed connection marks

 ($name,$path,$host,$port,$codes) = split (/\t/);
 if (substr($path,0,1) ne "1") {substr($path,0,0) = "1";}

   # the $codes field contains alias/IP info, geographic, date, and perhaps
   # a simple subject code, these could be checked here to change the file
   # destination of the link.  The $codes info is not used in this script.

 print OUT "Name=$name\n";
 print OUT "Type=1\n";
 print OUT "Path=$path\n";
 print OUT "Host=$host\n";
 print OUT "Port=$port\n";
 print OUT "#\n";

}
close(IN);
close(OUT);