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: doylej@liberty.uc.wlu.edu (John Doyle)
Subject: Re: Getting Gopher links
Message-ID: <1993Sep18.030159.26523@liberty.uc.wlu.edu>
Date: Sat, 18 Sep 1993 03:01:59 GMT
References: <00972A2A.86BF8E26@sacto.mp.usbr.gov>
Organization: Washington & Lee University
X-Newsreader: TIN [version 1.1 PL8]
Lines: 57

henrym@sacto.mp.usbr.gov 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.  doylej@liberty.uc.wlu.edu

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

#!/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);



