Alwanza Home Alwanza Bells and Whistles


#!/usr/bin/perl
#!C:\perl\bin


# this script has been modified for Windows
# sitemapMaker.pl by Meryll Larkin
# created 3/3/02      updated 3/6/02

# This perl script will:
# accept a base path provided by the user
# examine all files and directories beginning with
# that base path, recursively.
# Create links (either absolute or relative by user request)
# to files, arranged by folder
#
# Files beginning with . or _ will not be mapped
# if you want to change that, see the first grep
#
# The map will be printed as an HTML file to into
# whichever directory the user has specified.
# If the links are to be relative, they will be
# relative to the location of the generated HTML file.

# If you choose to create just a SiteMap table that you
# can paste into a skeleton page (rather than paste the
# opening and closing into this script), just comment out
# the invocations to the following subroutines:
# &print_end_html and &print_open_html

# ********************************************************

use strict;
use Cwd;
use integer;
{
# Customizeable Variables
my $siteTitle = "Site Title";
my $stylelink='<link href="../styles/style.css" rel=Stylesheet type=text/css>';
my $emailLink = "bogus\@bogus.com";
my $fontHeader = "<span class='header'>"; # "<font face=''>"
my $fontDir = "<span class='normal'>"; # "<font face=''>"
my $fontLink = "<span class='boldsmall'>"; # "<font face=''>"
my $fontSmall = "<span class='smallest'>"; # "<font face=''>"
my $fontClose = "</span>"; # "</font>"
my $backgroundColor = "#ffffff"; # page background color
my $backgroundImage = "../images/background.gif"; # page background image

# End Customizeable Variables

# FLAGS
my $BOO_REL_URL; # relative url, y or n ?
my $BOO_SPEC_EXT; # specify extentions of files to include, y or n?

# Variables
my $ra_fonts = [$fontClose, $fontHeader, $fontDir, $fontLink, $fontSmall];
my $sitemapURL;
my $sitemapPath;
my $baseURL; # usually same as domain URL
my $basepath;
my $nextdir;
my $rh_subdirectDone;
my $navString;
my @file;
my $file;
my $fileExt;
my @linkfiles;
my $dirlink;
my $divider = 0;
my $input;
my $boo_include;
my %includefiles = (
             html => ".html .htm .pdf",
             image => ".gif .jpg .jpeg .png",
             text => ".txt",
             jscript => ".js .css",
             sscript => ".pl .cgi .php .asp",
             word => ".doc .fm",
             music => ".mid .midi .wav .ram",
             log => ".log .cvs",
             xml => ".xml",
             exe => ".exe",
             # add others here
);
my @includefiles;
my $includefiles;

my $bgcolor = "bgcolor=\"" . $backgroundColor . "\"" if ($backgroundColor);
my $bgImage = "background=\"" . $backgroundImage . "\"" if ($backgroundImage);

$basepath=cwd();
$divider+=9 if $basepath =~ m|/|; # ix (Linux, Unix, 9)
$divider+=23 if $basepath =~ m|\\|; # win
if (($basepath =~ m|:|) &&
   ($basepath !~ m|^\w+\:\\[^\:]+$|) && ($basepath !~ m|^\w+\:/[^\:]+$|)) {
   $divider+=13; # mac
}
if (($divider == 22) || ($divider > 23)) {
   print "Invalid directory or file names\nQuitting";
   exit (0);
} else {
   $divider = "/" if $divider == 9; # ix (Linux, Unix, 9)
   $divider = "\\" if $divider == 23; # win
   $divider = ":" if $divider == 13; # mac
}

my $name = ucfirst($ENV{LOGNAME}); # doesn't work in Windows

print "\nHello $name\n";

print qq|

This script will create an HTML sitemap by recursively
   searching directories and creating links to files,
   organized by directory.
You may specify absolute or relative paths for the links.
You may specify which directories are included in the map.
You may specify which file types get included in the map.

You will be prompted at each subdirectory for inclusion in map.

You will also be asked to identify files for inclusion by
   their extension. You can choose to include all files or
   some files. |;

&query_proceed;
$BOO_REL_URL = &abs_or_relative;
$baseURL = &get_domain;
$sitemapURL = &locate_sitemap($divider);
$basepath = &get_basepath;
$basepath = &verify_and_goto_nextdir($basepath);

unless (opendir( MAPME, $basepath )){
   print "\nCan't open $basepath. Do you wish to rewrite? (y or n) ";
   $input = <STDIN>;
   $input = &validate_intgr_input($input);
   &continue_or_quit($input);
   $basepath = &get_basepath;
}

closedir MAPME;

($sitemapPath, $navString)=&reconcile_url_path($basepath, $baseURL, $sitemapURL, $divider);

open ( SITEMAP, ">>$sitemapPath" ) or die "Can't open $sitemapPath $!";

&print_open_html($siteTitle, $stylelink, $ra_fonts, $bgcolor);
&print_open_table;

($BOO_SPEC_EXT, %includefiles) = &select_files(%includefiles);

# begin @subdirectToDo with first $basepath
$nextdir = $basepath;
unshift (my @subdirectToDo, $basepath);

while ( defined $nextdir ) { # extracted from $subdirectToDo
   my @dirContents;
   my @subdirectFound; # reinitialize with each loop
   &verify_and_goto_nextdir($nextdir);
   opendir( MAPME, $nextdir ) or die "\nCan't open $nextdir ";

   # find all directory contents OTHER than those that begin in . or _
   @dirContents = grep !/^[_\.]/, readdir(MAPME);

   $dirlink = $nextdir;
   # replace basepath with either navString or baseURL depending on link type
   if ($BOO_REL_URL) {
      $dirlink =~ s|^$basepath|$navString|;
   } else {
      $dirlink =~ s/^$basepath/$baseURL/;
   }

   # separate the files from the subdirectories
    foreach my $dirContent(@dirContents) {
      if ((-s $dirContent) || (-d $dirContent)){
         if (-d $dirContent) {
            $dirContent = cwd() . $divider . $dirContent;
            push(@subdirectFound, $dirContent);
         } else {
            push(@file, $dirContent);
         }
      }
   }

   my $include = \%includefiles;
   &makelinks($BOO_SPEC_EXT, $dirlink, $baseURL, $ra_fonts, $include, @file);

   # all files in dir have been processed
   # empty file array so that it is ready for next dir
   @file = [];
   shift @file;
   pop @subdirectToDo;
   # are there additional subdirectories?
   if (! @subdirectFound ) {
      print "\nNo subdirectories were detected in\n $nextdir\n";
   } else {
      print "\nSubdirectories were detected inside \n$nextdir\n";
      $input = -2; # initialize for data validation
      while($input == -2) {
         print "\nWould you like to also map subdirectories within\n " .
         "this directory (y or n)? ";
         $input = <STDIN>;
         $input = &validate_intgr_input($input);
         if ($input == 1 ) {
            my @subdirectToAdd = &add_moredir(@subdirectFound);
            @subdirectToDo = (@subdirectToDo, @subdirectToAdd);
         }
      } # END while $input == -2
   } # END if/else @subdirectFound
   # compile an array of completed directories for
   # navigation purposes in &select_nextdir
   ${$rh_subdirectDone}->{$nextdir} = 1;

    if (@subdirectToDo) {
         ($nextdir, @subdirectToDo) = &select_nextdir($rh_subdirectDone, @subdirectToDo);
         ${$rh_subdirectDone}->{$nextdir} = 0;
   } else {
      $nextdir = '';

      &print_close_table;
      &print_end_html($emailLink, $ra_fonts);

       close SITEMAP;
      closedir ( MAPME );
      print "Job completed. Quitting.\n\nYour sitemap is here: $sitemapPath\n\n";
      exit (0);
   }
} # End while ( defined $nextdir )

&print_end_html($emailLink, $ra_fonts);
close SITEMAP;
closedir ( MAPME );
print "Job completed. Quitting.\n\nYour sitemap is here: $sitemapPath\n\n";
exit (0);

}
#********************************************************

sub query_proceed {
   print "\n\nDo you wish to proceed? (y or n) ";
   my $input = <STDIN>;
   $input = &validate_intgr_input($input);
   &query_proceed if $input == -2;
   &continue_or_quit($input);
}

#*****************************************

sub validate_intgr_input {
   my $input = shift;
   $input =~ s/\s*$//; # remove trailing spaces
   $input =~ s/^\s*//; # remove leading spaces
   $input = uc(substr($input, 0, 1));
   if (( $input ne "Y" ) && ( $input ne "N" )) {
         print "\n$input is not a valid answer.\n";
         print "Do you wish to continue? (y or n) ";
         $input = <STDIN>;
         $input = &validate_intgr_input($input);
         &continue_or_quit($input);
         return (-2);
   } else {
      # $input is now either "Y" or "N"
      $input = ($input eq "Y" ) ? 1 : 0;
      return ($input);
   }
}

#*****************************************

sub continue_or_quit {
   my $continue = shift;
   if ( $continue == 0 ) {
      print "Quitting per user request.\n";
      exit (0);
   }
   return 1;
}

#*****************************************

sub abs_or_relative {
   print "\nWould you prefer that the links be absolute\n ";
   print " example: http://www.domain.com/index.html\n\n";
   print "or relative\n ";
   print " example: index.html\n\n";
   print "Your choice? (a or r) ";
   chomp(my $BOO_REL_URL = <STDIN>);
   $BOO_REL_URL =~ /\w$/; # accept final word char only
   $BOO_REL_URL = "Z" if $BOO_REL_URL !~ /[aArR]/;
   $BOO_REL_URL = "N" if $BOO_REL_URL =~ /[aA]/;
   $BOO_REL_URL = "Y" if $BOO_REL_URL =~ /[rR]/;
   $BOO_REL_URL = &validate_intgr_input($BOO_REL_URL);
   &abs_or_relative if $BOO_REL_URL == -2;
   return $BOO_REL_URL;
}

#*****************************************

sub get_domain {
# print "\nYou have selected \"relative path\".\n";
   while (1) {
      print "\nPlease provide the URL of the domain\n";
      print " or base level URL for mapping: ";
      chomp(my $baseURL = <STDIN>);
      if ($baseURL !~ m|^http\://|i) {
         $baseURL ="http://" . $baseURL;
      }
      print "\n$baseURL\n\n";
      print "Is this the correct url? (y or n) ";
      chomp(my $url_good = <STDIN>);
      if (&validate_intgr_input($url_good)) {
         $baseURL .= "/" if $baseURL =~ m|/$|;
         return $baseURL;
      }
   }
}

#*****************************************

sub locate_sitemap {
   my $divider = shift;
   # print "\nYou have selected \"relative path\".\n";
   while (1) {
      print "\nPlease provide the absolute URL for the\n";
      print " location of the sitemap: ";
      chomp(my $sitemapURL = <STDIN>);
      if ($sitemapURL !~ m|^http\://|i) {
         $sitemapURL ="http://" . $sitemapURL;
      }
      if ($sitemapURL !~ m|$divider$|) {
         $sitemapURL .= $divider;
      }
      $sitemapURL .= "sitemap.html";
      print "\n$sitemapURL\n\n";
      print "Is this the correct absolute URL? (y or n) ";
      chomp(my $path_good = <STDIN>);
      if (&validate_intgr_input($path_good)) {
         return $sitemapURL;
      }
   }
}

#*****************************************

sub get_basepath {
   print "\nPlease provide the full absolute PATH to the\n";
   print " web files on your workstation: ";
   chomp(my $basepath = <STDIN>);
   print "\n$basepath\n\n";
   print "Is this the correct basepath? (y or n) ";
   chomp(my $base_good = <STDIN>);
   unless (&validate_intgr_input($base_good)) {
      &get_basepath;
   } else {
      return $basepath;
   }
}

#*****************************************

sub verify_and_goto_nextdir {
   my ($dir) = @_;
   my $dircurrent = cwd();
   my $datagood;
   TRYAGAIN:
   unless (( chdir $dir ) || ( $dircurrent eq $dir )) {
      print "\nCan't move into $dir $!\n\n";
      print "Try again, and follow this format:\n $dircurrent\n\n";
      $dir = &get_basepath;
      goto TRYAGAIN;
   }
   if ( $dircurrent ne $dir ) {
      print "\nIs this the next directory selected for mapping?\n\n";
      print " $dir (y or n) ";
      $datagood = <STDIN>;
      $datagood = &validate_intgr_input($datagood);
      if ( $datagood != 1 ) {
         $dir = &get_basepath;
      } else {
         $dir = cwd();
      }
   }
   return $dir;
}

#*****************************************

sub reconcile_url_path {
   my ($basepath, $baseURL, $sitemapURL, $divider) = @_;
   # basepath ex: c:/web_sites/this_website/
   # sitemap_url: www.websites.com/this_website/about/sitemap.html
   my @commondir;
   my @navigationdir;
   my $commonfound;
   my $alternate;
   my $dir;
   my $navString;
   my ($i, $j);
   $basepath =~ s|\W$||; # remove final nonword char
   my $reconcileMapURL = $sitemapURL;
   $reconcileMapURL =~ s|\/sitemap.html||;
   if ($reconcileMapURL =~ /^$baseURL$/i) {
      $navString = '';
   }
   else {
      $reconcileMapURL=~ s|^\W?http\://||;
      $baseURL=~ s|^\W?http\://||;
      my @reconcileMapURL = split('/', $reconcileMapURL);
      my @baseURL = split('/', $baseURL);
      my $reconcileNumber = $#reconcileMapURL - $#baseURL;
      if (($reconcileMapURL =~ /$baseURL$/) || ($reconcileNumber < 1)) {
         die "Map URL not a subdirectory of domain $!";
      } else {
         for (1..$reconcileNumber) {
            $navString .= "../";
         }
      }
   }

   my $sitemapPath = $sitemapURL;
   $sitemapPath =~ s|^http\://||i;
   $alternate = $sitemapPath;
   $sitemapPath =~ s|/sitemap.html$||;
   my @sitemapDirs = split($divider, $sitemapPath);
   my @basepath = split($divider, $basepath);
   my $last = $#sitemapDirs;
   OUTERLOOP:
   foreach $basepath(@basepath) {
      foreach my $sitemapDirs(@sitemapDirs) {
       if ($basepath eq $sitemapDirs) {
            $dir = $sitemapDirs;
            push(@commondir, $dir);
            next OUTERLOOP;
         }
      }
   }
   $commonfound = join($divider, @commondir);
   $_ = $basepath;
   /^(.*)$commonfound.*$/;
    # if no $commonfound, $begin will be entire basepath;
   my $begin = $1;
   $_ = $sitemapURL;
   /^.*$commonfound(.*)$/;
   my $end = $1;
   $alternate =~ s/^.*?$divider//; #strip off domain
   $alternate = $divider . $alternate;
   $end = $commonfound !~ /\w+/ ? $alternate : $end;
   $sitemapPath = $begin . $commonfound . $end;
   my $sitemapPath2 = $sitemapPath;
   $sitemapPath2 =~ s/sitemap.html/sitemap_old.html/;
   if ( -e $sitemapPath ) {
      rename ($sitemapPath, $sitemapPath2) || die "can't rename $sitemapPath $!";
   }
   return ($sitemapPath, $navString);
}

#*****************************************

sub select_files {
   my %includefiles = @_;
   my @includefiles;
   my $includefiles;
   my $filetype;
   my $boo_include;
   print "\nWould you like to SELECT specific file types\n";
   print " for links in the site map\n";
   print " or would you prefer to make\n";
   print " links to ALL files in selected ";
   print "directories?\n selected or all ";
   print "Your choice? (s or a) ";
   chomp(my $BOO_SPEC_EXT = <STDIN>);
   $BOO_SPEC_EXT = "Z" if $BOO_SPEC_EXT !~ /[aAsS]/;
   $BOO_SPEC_EXT = "Y" if $BOO_SPEC_EXT =~ /[sS]/;
   $BOO_SPEC_EXT = "N" if $BOO_SPEC_EXT =~ /[aA]/;
   $BOO_SPEC_EXT = &validate_intgr_input($BOO_SPEC_EXT);
   &select_files if $BOO_SPEC_EXT == -2;
   if ($BOO_SPEC_EXT) {
      print "\nPlease indicate which files you would like to include";
      for my $type (keys %includefiles) {
         print "\n\ninclude these: $includefiles{$type} (y or n)? ";
         chomp($boo_include = <STDIN>);
         $boo_include = &validate_intgr_input($boo_include);
         if ($boo_include == 1) {
          $type = $includefiles{$type};
          push (@includefiles, $type);
         }
         redo if $boo_include == -2;
      }
      # flatten $includefiles
      $includefiles = join(' ', @includefiles);
      # make each list item one extension
      @includefiles = split(' ', $includefiles);
      # add alternating values for hash
      $includefiles = join(' 1 ', @includefiles);
      $includefiles .= ' 1' if $includefiles =~ /\w/;
      @includefiles = split(' ', $includefiles);
      %includefiles = @includefiles;
      print "The following file types will become links:\n";
      foreach $filetype (keys %includefiles) {
         print "$filetype\n";
      }
   }
   print "\n";
   return ($BOO_SPEC_EXT, %includefiles);
}

#*****************************************

sub add_moredir {
   my (@subdirectFound) = @_;
   my @subdirectToAdd;
   print "\nWhich subdirectories would you like to include?\n";
   print "Write y or n after each:\n";
   foreach my $subdirectFound ( @subdirectFound ) {
      print "\n subdirectory found:\n";
      print " $subdirectFound (y or n)? ";
      my $includeSub = <STDIN>;
      $includeSub = &validate_intgr_input($includeSub);
      if ( $includeSub == 1 ) {
         print "\nLinks will be made for files in " .
          "subdirectory:\n $subdirectFound\n\n";
         push(@subdirectToAdd, $subdirectFound);
      }
      redo if $includeSub == -2;
   } # END foreach my $subdirectFound ( @subdirectFound )
   return @subdirectToAdd;
}

#*****************************************

sub select_nextdir {
   my ($rh_subdirectDone, @subdirectToDo) = @_;
   my $dir_old = cwd();
   my $dircurrent;
   my $nextSub;
   # navigate to children, grandchildren, before aunts
   for my $subdirect(reverse(@subdirectToDo)) {
      if (( defined $subdirect) &&
         ((not defined ${$rh_subdirectDone}->{$subdirect}) ||
         (${$rh_subdirectDone}->{$subdirect} == 0 ))) {
         print "\nNow mapping $subdirect\n\n";
         $nextSub = $subdirect;
         last;
      }
   }
   opendir(MAPME, $nextSub) || die "subdirectToDo=\n @subdirectToDo\n" .
   "Can\'t change into nextSub $nextSub, $!";
   unless ( chdir $nextSub) {
      print "\nCan\'t change into $nextSub, $!";
   }
   $dircurrent = cwd();
   if ($dircurrent eq $dir_old) {
      print "\nData transfer error\nQuitting\n";
      print "$dircurrent = $dircurrent\ndir_old = $dir_old\n";
      exit (0);
   }
   closedir (MAPME);
   return ($dircurrent, @subdirectToDo);
}

#*****************************************

sub print_open_html {
   my ($siteTitle, $stylelink, $ra_fonts, $bgcolor, $bgImage) = @_;
   my $fontClose = $ra_fonts->[0];
   my $fontHeader = $ra_fonts->[1];
   print SITEMAP qq|
<html>
<head>
<title>$siteTitle:&nbsp;&nbsp;Site Map</title>
<meta name="generator" content="sitemapMaker.pl by Meryll Larkin">
$stylelink
</head>
<body $bgcolor $bgImage topmargin="0" leftmargin="0" marginheight="0"
marginwidth="0">

<tABLE BORDER="0" CELLPADDING="20" CELLSPACING="0" WIDTH="100%"><!-- t1a open -->
   <tr>
    </td>
    <td VALIGN="CENTER" ALIGN="LEFT">
      <table border="0" cellpadding="6" cellspacing="0" width="100%"><!-- t2a open -->
       <tr>
         
          <td>
      <table border="0" cellpadding="0" cellspacing="0" width="100%"><!-- t3a open -->
       <tr>
          <td align="center">
             $fontHeader$siteTitle Site Map$fontClose
          </td>
       </tr>
       <tr>
          <td height="6" > </td>
       </tr>
       </table><!-- t3a close -->

          </td>
       </tr>
       <tr>
          <td align="left">

|;

    return 1;
}

#*****************************************

sub makelinks {
   my ($BOO_EXT, $dirlink, $baseURL, $ra_fonts, $includefiles, @file) = @_;
   my $fontClose = $ra_fonts->[0];
   my $fontLink = $ra_fonts->[3];
   $dirlink =~ s|//|/|g;
   my $dirName = $dirlink;
   $dirName =~ s|/$||; # remove end /
   $dirName =~ s|\Q../\E$||g; # remove all ../
   # $dirName =~ s|.*/||; # remove all up to final /
   &print_directory($dirName, $baseURL, $ra_fonts);

    my @filelinks;
   foreach my $file( sort @file ) {
      if ($BOO_EXT) {
         $_ = $file;
         /^.*(\.\w+)$/;
         my $fileExt = lc($1);
         if ($includefiles->{$fileExt}) {
            push(@filelinks, $file);
         }
      } else {
         push(@filelinks, $file);
      }
   }
   my $filecount = $#filelinks + 1;
   my $rowcount = (($filecount + 2)/3);
   $rowcount++ if $rowcount == 0;
   my $startcount = 1;
   my $linkcount;
   for (1..3) {
      my $columncount = $_;
      for ($startcount .. $rowcount) {
         if ($linkcount != $filecount) {
            $linkcount = $_ - 1;
         }
         my $Lfile = $filelinks[$linkcount];
         &print_file_link($Lfile, $dirlink);
      }
      print SITEMAP " </ul>\n $fontClose\n </td>\n";
      if ($columncount < 3) {
         print SITEMAP "<td align=\"bottom\" width=\"35%\"> $fontLink\n<ul>";
      } else {
         print SITEMAP " \n </tr>\n";
      }
      $startcount = $rowcount + 1;
      $rowcount += $rowcount;
      $rowcount = $rowcount > $filecount ? $filecount : $rowcount;
   }
}


#*****************************************

sub print_open_table {

   print SITEMAP qq|
<!-- ************************************************************* -->

<!-- BEGIN SITE-MAP TABLE HERE -->
<table border="0" cellpadding="0" cellspacing="0" width="100%"><!-- t3b open -->
<tr>
   <td width="40%"> </td>
   <td width="35%"> </td>
   <td width="25%"> </td>
</tr>
|;
   return 1;
}

#*****************************************

sub print_directory {
   my ($directory, $baseURL, $ra_fonts) = @_;
   my $fontClose = $ra_fonts->[0];
   my $fontDir = $ra_fonts->[2];
   my $fontLink = $ra_fonts->[3];
   $directory =~ s|^\W?http\:||i;
   $directory =~ s|//|/|g;
   $directory =~ s|/$||; # remove end /
   $directory =~ s|^/+||; # remove beginning /
   $directory =~ s|\Q../\E||g; # remove all ../

    if ($directory !~ /\w/) {
      if ($baseURL =~ /\w{3}\.(.*)\.\w{3}/) {
         $directory = $1;
      } else {
         $directory = $baseURL;
      }
   }
   my $printstring = $fontDir . $directory . $fontClose;
   print SITEMAP qq|
      <tr>
      <td height="20" valign="bottom"
       align="center" colspan="3"><hr width="75%"></hr></td></tr>
      <tr>
      <tr>
      <td height="30" valign="bottom" colspan="3">$printstring</td></tr>
      <tr><td valign="bottom" width="40%"> $fontLink\n <ul>
      |;
   return 1;
}

#*****************************************

sub print_file_link {
   my ($file, $dirlink) = @_;
   return 1 if !$file;
   # fix relative path to work with base or child dirs
   $dirlink = $dirlink . "/";
   $dirlink =~ s|//|/|g;
   $dirlink =~ s|^\W?http\:/[^/]|http://|i;
   # if $dirlink does not contain either word chars
   # and if $dirlink does not end in ../
   if (($dirlink !~ /\w/) && ($dirlink !~ m|../$|)){
      # strip off final / when dirlink is empty string
      $dirlink =~ s|/$||;
   }
   $dirlink =~ s|^/||;
   my $filelink = $dirlink . $file;
   my $printstring;
   $printstring = "<li><a href=\"$filelink\">$file</a>\n</li>";
   print SITEMAP "$printstring\n";
   return 1;
}

#*****************************************

sub print_close_table {

   print SITEMAP qq|
      <tr>
      <td height="20" valign="bottom"
       align="center" colspan="3"><hr width="75%"></hr></td></tr>
</table><!-- t3b close -->

<!--END SITE-MAP TABLE HERE-->

<!-- ************************************************************* -->

|;
   return 1;
}

#*****************************************

sub print_end_html {
   my ($emailLink, $ra_fonts) = @_;
   my $fontClose = $ra_fonts->[0];
   my $fontSmall = $ra_fonts->[4];
   # retrieve current time as a long integer, put it into $t
   my $t = time();
   my $localTime = localtime($t);
   my ($sec, $min, $hour, $dom, $mon, $year) = localtime($t);
   $year += 1900;
   # for $mon, January is zero
   my @months = qw(January February March April May
       June July August September October November December);

   print SITEMAP qq|

          </td>
         </tr>
          <tr>
          <td height="60"> 
          </td>
         </tr>
          <tr>
          <td>$fontSmall Please email to
             <a href="$emailLink">$emailLink</a>
             if you have any comments or questions about this page.
             <br><br>
             Updated:  $months[$mon] $dom, $year
          $fontClose
          </td>
         
       </tr>
      </table><!-- t2a close -->
    </td>
   </tr>
</table><!-- t1a close -->
<br>
</body>
</html>


|;

   return 1;
}

#************************ END