#!/usr/bin/perl # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # #NAME # .../cgi/abc/index.cgi - Root page for JC's tune finder CGI directory # #SYNOPSIS # http://cgi/abc/index.html # #REQUIRES $version = '20170429'; $keywords = 'musician,sheet-music,notation,instrument,lesson,manuscript'; require &LocalSetup(1); # Figure out localization stuff require 'names.pm'; # Program name table require 'sendsubs.pm'; # #DESCRIPTION # #OPTIONS # #EXAMPLES # #FILES # #BUGS # #SEE ALSO # #AUTHOR # John Chambers # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # $| = 1; $exitstat = 0; print "\n"; print "Content-type: text/html\n"; print "\n"; $frm = $CGI{'tuneform'} || 'tuneform'; # Name of the program that asks for formatting info $get = $CGI{'tuneget'} || 'tuneget'; # Name of the program that gets a tune and converts it if (1) { $fqdn = '??' unless defined $fqdn; $A{E} = '??' unless defined $A{E}; # $csslink = '??' unless defined $csslink; # $cssdata = '??' unless defined $cssdata; } print "\n"; print "\n"; print "\n"; print "JC's ABC Tune Finder directory on $fqdn\n"; print "\t\n"; print "\t\n"; print "\t\n"; print "\t\n"; if ($sendcss) { print "[CSS]\n" if $V>2; print &getCSS(); } print "\n"; print "\n"; print "
\n"; print "
[$P] Called from $RA with verbose level $V at $ymd $hms UTC.
\n"; print "

Hi!\n"; print "I'm a program pretending to be an index.html page.\n"; print "The point of this page is to provide a general entry-point to \n"; print "\tJC's Tune Finder,\n"; print "show the top-level tools that are kept here,\n"; print "and help other search sites by presenting a list a few keywords that apply to everything here.\n"; &webpage("$docdir/Disclaimer_en.html"); print "

Everything here starts with the one program: "; print "\n"; print "\n"; print "tunefind\n"; print " looks up ABC tunes in our index of several hundred web sites.\n"; print "\n"; print "

Some more programs that aren't very useful when called directly: "; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
 tuneaddadds an ABC file to the contrib/ directory.
tuneformlets you select formatting options for converting ABC to printable formats.
tunegetextracts an ABC tune from a site's file and converts it to any of several formats.
tunelistlists a directory's contents, expanding ABC files to show the tunes.
\n"; print "

\n"; print "


\n"; print "Notice: Due to problems with file names on Windows and Mac OSX systems,\n"; print "the names of the programs here are now entirely lower case.\n"; print "If you were using tunefind or tuneget, they are now tunefind and tuneget.\n"; print "They are also called findtune and gettune, but FindTune and GetTune don't exist any more.\n"; print "\n"; print "
\n"; &ads() if $sendads; print "
\n"; print "\n"; print "\n"; print "\n" if $V>1; exit $exitstat; # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # sub LocalSetup { $Vtest = shift; # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Figure out where we're running, and try to require a *cgilocal.pm file for # # local settings. The end result of this is to initialize a long list of # # global variables. The return value is the name of the cgilocal file, which # # we usually feed to the 'require' command. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # $ENV{PATH} = '/bin:/sbin:/usr/bin:/usr/sbin'; push @INC, '.'; umask 0002; # Output files must be group writable $| = 1; # Unbuffered STDOUT $" = ','; # Used in verbose messages ($P = $0 || 'INDEX') =~ s".*/""; $Venv = (defined($ENV{"V_$P"}) ? $ENV{"V_$P"} : '1') . ' 1'; $Vsrc = "Venv='$Venv'"; $Venv =~ /(\d+)/; # Verbose level $V = $1; $Vtest = 1 unless defined $Vtest; ($ENV{REMOTE_ADDR} || '0.0.0.0') =~ m/^\s*([\d.]+)\s*$/; $RA = $1; if ($RA eq '207.172.223.184') { # My home machine if ($V<$Vtest) {$V = $Vtest; $Vsrc = "Vtest=$Vtest"} } elsif ($RA =~ /^192\.168\./) { # My home network $V = $Vtest if $V<$Vtest; if ($V<$Vtest) {$V = $Vtest; $Vsrc = "Vtest=$Vtest"} } local($ss,$mm,$hh,$DD,$MM,$YY) = gmtime($now = time); # Current date/time $ymd = sprintf("%d-%02d-%02d",1900+$YY,1+$MM,$DD); # CCYY-MM-DD $hms = sprintf("%02d:%02d:%02d",$hh,$mm,$ss); # HH:MM:SS $hostname = `/bin/hostname`; # What does this machine call itself? $hostname =~ s/^\s*([-.\w]*)([\r\s]*)$/$1/; # Strip off white stuff ($host = $1) =~ s/\..*//; # Extract first field of name $hstloc = $host . "-cgilocal.pm"; $cgiloc = (-f $hstloc) ? $hstloc : 'cgilocal.pm'; return $cgiloc; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #