#!/usr/bin/perl #Make indexes for a website. #get the directory to start the indexing $BaseDir = "/home/web/mbbnet"; $WAISDB = "/home/web/mbbnet/search/mbbnet"; $webdir = "http://www.mbbnet.umn.edu"; my @NeedsIndexing=&GetHtmlDirs; &Index (@NeedsIndexing); sub Index { my @NeedsIndexing = @_; my $count = 0; my @htmls = `ls *.html`; my $dir = ""; foreach $file (@htmls) { `waisindex -t URL $BaseDir $webdir -d $WAISDB -a *html`; } foreach $dir (@NeedsIndexing){ chop $dir; system ("waisindex -t URL $BaseDir/$dir $webdir -d $WAISDB -a $dir/*html"); $count++; } print "\n\nIndexed ", $count, " directories\n"; } sub GetHtmlDirs { my @AllListings = `ls`; my @htmldirs = ""; foreach $file (@AllListings){ chop $file; #makes sure we look in directories if (-d $file){ push (@htmldirs, $file); } } return (@htmldirs); }