#!/usr/bin/perl ################################################################### # Building a Web Site Index by Keywords to Search # # with JavaScript SiteSearch Engine, see: # # http://members.tripod.com/~schick/sitesuche.html # # # # Version 3.0 4Jun99, Perl Version 5.001 Win32 # # written by Arnold Schick (Copyright) # # # # This Perl script is free for domenstic use # # and is provided "as it is" (using at your own risk) # # # # This Perl script >>start.cgi<< is to copy into # # your cgi-bin directory on your local machine # # (file: http://members.tripod.com/~schick/start.txt) # # AND the related Perl script: key.cgi # # (file: http://members.tripod.com/~schick/key.txt) # # AND the related Perl script: spage.cgi # # (file: http://members.tripod.com/~schick/spage.txt) # # # # The HTML document with a link and FORM element to get this # # start page looks like # # # #
# # # #
# #get Start Page # # # # # # List of used files and names: # # # # Names: Perl script : start.cgi # # Perl script : key.cgi # # Perl script : spage.cgi # # call: /cgi-bin/start.cgi from a FORM, method=post (s. above) # # # # note: this script create files which are to # # name within a FORM of that related # # HTML document, deleting of files is # # also possible. # # # # Don't place this script into a public cgi-bin directory # # on a public Web server, it's a maintain tool of # # your own Web Site files on a local machine (PC) # # # # if you use Apace Web server on WIN32, use the directive # # #!perl in place of #!/usr/bin/perl at top of this script # # # ################################################################## ################################################### # Please define a temporary file below: # # there will be save paths and dir names # ################################################### $temp_file="c:\\tmp\\js_tmp.dat"; $content_length = $ENV{'CONTENT_LENGTH'}; read(STDIN, $posted, $content_length); $posted =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $posted =~ s/\+/ /g; @fields = split (/&/, $posted); foreach $name (@fields) { ($n, $w) = split(/=/, $name); $tokens{$n} = $w; } if (($temp_file) and (-e $temp_file)) { open(INFILE, "<$temp_file"); chomp; @allLines = ; close(INFILE); if (@allLines) { foreach $line (@allLines) { $line =~ tr/\n\r\f\t\b/ /s; $line =~ tr/ //d; ($if, $lf, $sp) = split(/,/, $line); unshift(@indexfiles, $if); unshift(@localfiles, $lf); unshift(@serverpath, $sp); } } } else { $indexfiles[0] = (""); $localfiles[0] = (""); $serverpath[0] = (""); } @indexfiles = sort keys %{{map {$_,1} @indexfiles }}; @localfiles = sort keys %{{map {$_,1} @localfiles }}; @serverpath = sort keys %{{map {$_,1} @serverpath }}; print "Content-type: text/html", "\n\n"; print "\n\n"; print "\n"; print "\n"; print < Administrator Tool

Web Site Tool: Administration of Files for a Web Site
List  Keywords, Page Titles
and  Creates  an  Index  File
Name of local Work Subdirectory:
   absolute path
PART1 ; if (@localfiles and $temp_file) { print " \n"; } print <
List Files:
newest first
oldest first
by alphabetical order
by reverse alphabetical order
+ server path + local path no path  

JavaScript SiteSearch Index File:
create and overwrite existing
append to existing Index File
delete
existing Index File

  Name of Index File:
  absolute path
PART2 ; if (@indexfiles and $temp_file) { print " \n"; } print <
Name of Virtual Subdirectory
for your Web Files at the Web Server:
   relative path
PART3 ; if (@serverpath and $temp_file) { print " \n"; } print <      always used on Index File
Filetype:                       select all

or Filetype:
no wildcharacters

created by Arnold Schick     

back

created with Perl Script written by Arnold Schick

PART4 ; # finally, clean up, be sure for the next run: $posted=""; ################ End of this Perl Script #############################################