#!/usr/local/bin/perl # Copyright (C) 1996 Thomas R. Metcalf # # This software is provided "as is" and is subject to change without # notice. No warranty of any kind is made with regard to this software, # including, but not limited to, the implied warranties of # merchantability and fitness for a particular purpose. The author shall # not be liable for any errors or for direct, indirect, special, # incidental or consequential damages in connection with the furnishing, # performance, or use of this software: use it at your own risk. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # $RootPath = "/data1/WWW/Tropical/GifArchive"; $WWWRoot = "/Tropical/GifArchive"; $TableCols = 5; #setpriority(0,0,getpriority(0,0)+6); # nice the process # Get archive listings opendir(GIFDIR,"$RootPath"); # Read directory @giffiles = readdir(GIFDIR); closedir(GIFDIR); if (@giffiles >= 1) { grep($_ = "$WWWRoot/".$_,@giffiles); # Add root to file names } # Sort the list of gif files by file name sub by_file_name { $a1 = (reverse(split(m|/|,$a)))[0]; $b1 = (reverse(split(m|/|,$b)))[0]; $ayear = substr($a1,length($a1)-6,2); $byear = substr($b1,length($b1)-6,2); if ($ayear < 94) {$ayear += 2000;} else {$ayear += 1900;} if ($byear < 94) {$byear += 2000;} else {$byear += 1900;} $aname = substr($a1,0,length($a1)-7); $bname = substr($b1,0,length($b1)-7); ($byear <=> $ayear || $aname cmp $bname); } @stormfiles = grep(/(\w+\-\d\d\.gif)$/i,@giffiles); @stormfiles = sort by_file_name (@stormfiles); # Set HTML Header and Footer $html_header = <<"HEADER_END";
Each gif image (~10 kB) shows storm tracks for the indicated storm. Due to a bug in RSI's contintent plotting software, some of the plots may look a bit strange. You must use a browser capable of displaying tables to view this page.
LEGEND_END $html_footer = <<"FOOTER_END";
accesses FOOTER_END # Generate the HTML output print "$html_header\n"; if (@giffiles < 1) { # No gif files in the directory print "
| $name | \n"; } print "