#!/usr/bin/perl
#############################################################
# CONFIGURATION
#
# ANACONDA ODP MAIN SCRIPT
#
# Make sure to set the first line to point to your perl5 binary!
#
$aversion="Anaconda Version: [1.8] [OPEN DIRECTORY PRO] [12/05/99]";
#
#
# Uncomment this line to pull results from DMOZ.org instead of the directory.netscape.com site. 
$useDMOZsite = 1;
#
#
# Uncommenting this next line will filter out the "Contributing Editors:" list at
# the end of each page of the Open Directory.  
# We HIGHLY DISCOURAGE you from doing this.  The OD only exists because of their hard
# *volunteer* work, and they certainly deserve the credit.
# Please only use this option if you must.
$removeeditors = 1;
#
# Uncomment this line to remove the ICQ (little flowers) icons from the Editor list.
$AP_removeicqicons = 1;
#
# Uncomment this line to remove the entire section of links to additional search engines.
$AP_removeengines = 1;
#
# Uncomment and set these in order to override the category and site heading text.
$AP_odpcattext = "Categorie";
$AP_odpsitetext = "Siti";
#
# In order to override the "Top" text and url,
# Uncomment and set this to whatever you want the "Top" text to be.
$toplinktext = "Open Directory";
#
# then uncomment and set this to whatever you want the "Top" url to be.
$toplinkurl = "http://www.olivettiweb.com/index.html";
#
#
# HTML template file for the Open Directory results.
# Pass a "template" field in a get or post to override this.
$defaulttemplatefile = "atemplate.html";
#
# Template file directory
# If this is left commented out, the template files are assumed to be in the same directory 
# as the anacondaodp.pl file
$templatedir = "/usr/home/olivetti/public_html/odp/";
#
#
# web server platform
$http_os = "NT"; # UNIX or NT
#
#
# Log file name (for logging search terms).
# This is useful for learning what your visitors are interested in.  It allows you to target
# them with better choices of recommended books, etc.  Uncomment the line to turn it on.
# NOTE: some server require you to pre-create the file, and verify the permissions are writable by all
$logfile = "anacondalog.txt";
#
# Uncomment this to have hyperlinks to other sites in the directory open a new browser window
$newbrowserwindow=1;
#
#
# General Booklink options
# Comment this out to have the booklink links *not* open a new window.
$booklinknewbrowser = 1;
#
# Amazon Booklink options
#
# Comment this out to disable the Amazon booklink generation.
#$booklinkamazon = 1;
#
# IMPORTANT: Change this to your own associate code.
#$amazonassociateid = "anacondapartners";
#
# This is set to link directly to Amazon by default.  If you have either Anaconda Search, or
# Anaconda Pipeline, you can link to them instead.  Just set the $amazonaction to
# point to your Anaconda script instead.
$amazonaction = "http://www.amazon.com/exec/obidos/external-search";
#$amazonaction = "/cgi-local/anaconda.pl";
#
# Set this to the location of your amazon button in order to display it with the booklink.
# If you leave this commented out, a booklink with no graphic with be generated.
#$amazonbutton = "/images/amazonbutton.gif";
#
# Barnes and Noble Booklink options
# These settings are similar to the Amazon ones, only for BN.com
#
#$booklinkbn = 1;
#$bnsourceid = "11476";
$bnaction = "http://barnesandnoble.bfast.com/booklink/click";
#$bnaction = "/cgi-local/anacondabnn.pl";
#$bnbutton = "/images/bnbutton.gif";
#
#
###################################################################################################
# Uncomment this setting in order to enable the smart caching of results pages from the host site.
# NOTE: the final parsed page is actually cached.  Meaning, *after* inserting the results into the
# template file.  So if you make changes to your template file, you should purge the cache (as
# described below) before the new templates changes will be seen on pages that have been cached.
# NOTE2: this option does not attempt to monitor or manage the disk space used by the cache files.
# You should make sure and keep and eye on this, set the maxdepth, full, and limit branches effectively,
# and purge the cache from time to time.
$usecache = 1;
#
# This option allows you to view the debug messages regarding the caching.  They are placed in the
# template whereever the <!-- ANACONDADEBUG --> tag is found.  The message is "fetching..." when
# the page is fetched from the site, or "opening..." when the page is found in the cache.  The name
# of the cache file is also given.  You can enable this option, load some pages to see the caching
# work, then disable it for your users.
$debug = 1;
#
# Set ttl (time-to-live) to the number of days that a cache page is used before re-fetching from the host site.
$cachettl = 7;
#
# Directory (Absolute or relative to cgi-bin directory) where cache files will be stored.  Make sure this
# directory is completely writeable by the cgi process.  We use a 777 chmod (permissions) setting on the 
# cache directory itself.
$cachedir = "cache";
#
# Maximum depth to cache pages.  "Top" page is 1, each page off the "top" page is depth 2, each page off
# a depth 2 page is depth 3, etc.  If you link to a depth 3 page from a depth 6 page...it is considered to be depth
# 3, and not depth 7.
$cachemaxdepth = 4; # for none-full branches
#
# List the branches that you want to fully cache (full depth) here.  If you have a site that specializes
# in a specific topic, you might want to fully cache just that topic.
@cachefullbranches =  ( "World", "Shopping", "Regional" );
#
# List the branches that you do not want cached at all.  Perhaps you want to ensure a particular
# branch is always up-to-date, or you just don't want to take the space for something specific.
# Limit branched take precedence over Full branches.  So if you list Recreation as a full branch,
# but limit Recreation/Travel as a limit branch....the limit *will* be in effect.
@cachelimitbranches = ( "Games", "Reference" );
#
# You can purge (delete) the cache files by passing a ?command=cachepurge**** to the
# script where **** is the password listed below.  This will delete all files that are
# older than the cachettl setting.  You can use cachepurgeall*** to delete all files regardless
# of cachettl.
$cachepurgepw = "murphy";
#
###################################################################################################
#
#
# maximum time to wait for host site
$maxtime=20;
#
# These setting should be used when there is a timeout problem with the host site. 
# First try the AP_use_original line, then try the AP_use_LWP line.  Remove the #
# sign to try out each setting.
#$AP_use_LWP = 1;
$AP_use_original = 1;
#
#
###### PLEASE CHANGE NOTHING BELOW THIS LINE! ##################################
 $I111I11III11I111=$sitecode; $I11I1111II1I11I1=$newbrowserwindow;
$I11I1I1I1IIIII1I=$defaulttemplatefile; $I1III1II111III1I=$templatedir;
$I1II11I1I1111III=$http_os; $I1I1I11111111III=$logfile; $I11III1III1111I1 = $removeeditors;
$I1II111111111I1I=$maxtime; $I11II11IIIIIIIII = $useDMOZsite;
$I1I11I1I11I11II1 = $toplinktext; $I1I111II1II11111 = $toplinkurl;
$I1III1IIIII1I11I = $usecache; $I1III1I111IIII1I = $debug; $I1II1I1I11II1111 = $cachettl;
$I1I1I11I1I11I111 = $cachedir; $I1III11III1I111I = $cachemaxdepth; 
@I111III11I11II11 =  @cachefullbranches; @I111111II111IIII = @cachelimitbranches;
$I1IIIIIII1III1II = $cachepurgepw; $I111II1I1III11II=$suppressnav;
$I1II1II1111111I1=$AP_removeengines; $I1IIIIII11II1III=$AP_removeicqicons;
$I1II1I111I1IIII1 = $AP_odpcattext; $I1II1I11I111I1I1 = $AP_odpsitetext;
use Socket; InitStuff(); $I1IIII1I1I1I1I1I=""; $I111II1III11IIII="";
$I11III1111I111I1=""; $I11I1I1III1I11I1=""; $I1I1III1111II1II="";
$I1II11111IIII11I=""; $I1IIIII1I11I1111=""; $I1IIII1I1I1I1I1I="";
if($I11II11IIIIIIIII) { $I11I11III111I11I="dmoz.org"; $I1I1I1I1II1II11I="search.dmoz.org";
} else { $I11I11III111I11I="directory.netscape.com"; $I1I1I1I1II1II11I="search.netscape.com";
} $I1I11I1I1111I11I=$aversion; $I1II1111IIII111I = $booklinknewbrowser;
$I1II111111IIII1I = $booklinkamazon; $I11I1I1I1I11III1 = $amazonassociateid;
$I1II11I1II11III1 = $amazonaction; $I1II1I1111II1II1 = $amazonbutton;
$I1II1II1111II1I1 = $booklinkbn; $I1I111I1I11III1I = $bnsourceid;
$I1II11I1III11I11 = $bnaction; $I1IIII1IIII11I11 = $bnbutton;
$| = 1; $I111I1111I11I1I1 = ""; $I11I1II11III1I11 = $ENV{SCRIPT_NAME};
unless($I11I1II11III1I11 =~ /^\//){ $I11I1II11III1I11 = "/$I11I1II11III1I11"; }
$I1III11I11II1III = $ENV{'QUERY_STRING'} . "&"; $I1III11I111I111I=0; 
print "Content-type: text/html\n\n"; $_=$I1III11I11II1III; if(!($I1I11I1I1111I11I =~ m|\w:\s*\[.*?\]\s*\[.*?\]\s*\[.*?\]|i))
{ print "INVALID ANACONDA INSTALLATION!\n"; exit; } if(m/command=(.*?)\&/i) { $I1IIIII1I11I1111=URLDecodeString($1); s/command=(.*?)\&//i; }
if($I1IIIII1I11I1111 =~ m|version|i) { print "$I1I11I1I1111I11I\n";
exit; } if($I1IIIII1I11I1111 =~ m|cachepurge|i) { if(!($I1IIIII1I11I1111 =~ m|$I1IIIIIII1III1II|))
{ print "Invalid Password"; exit; } if($I1IIIII1I11I1111 =~ m|cachepurgeall|i)
{ $I1I11111111111II = 1; } opendir(cachedir1, $I1I1I11I1I11I111);
while ($I11111III11I11I1 = readdir(cachedir1)) { if(($I11111III11I11I1 =~ m|AODP|i) && ($I1I11111111111II || ((-M $I11111III11I11I1) > $I1II1I1I11II1111)))
{ print "deleting $I11111III11I11I1<BR>"; unlink("$I1I1I11I1I11I111/$I11111III11I11I1");
} } print "finished!<BR>"; exit; } s/submit.x=.*?\&//i; s/submit.y=.*?\&//i;
$I11111111II11I11=""; if(m/template=(.*?)\&/i) { $I11III11I11I1111=$1; s/(template=.*?\&)//i; $I11111111II11I11 .= $1; }
if(m/postkey=(.*?)\&/i) { $I1111III1I1I11I1=URLDecodeString($1); s/(postkey=.*?\&)//i; $I11111111II11I11 .= $1; }
if(m/prekey=(.*?)\&/i) { $I11111I11I1I11II=URLDecodeString($1); s/(prekey=.*?\&)//i; $I11111111II11I11 .= $1; }
if(m/f1=(.*?)\&/i) { $f1=URLDecodeString($1); s/(f1=.*?\&)//i; $I11111111II11I11 .= $1; }
if(m/f2=(.*?)\&/i) { $f2=URLDecodeString($1); s/(f2=.*?\&)//i; $I11111111II11I11 .= $1; }
if(m/f3=(.*?)\&/i) { $f3=URLDecodeString($1); s/(f3=.*?\&)//i; $I11111111II11I11 .= $1; }
if(m/f4=(.*?)\&/i) { $f4=URLDecodeString($1); s/(f4=.*?\&)//i; $I11111111II11I11 .= $1; }
if(m/f5=(.*?)\&/i) { $f5=URLDecodeString($1); s/(f5=.*?\&)//i; $I11111111II11I11 .= $1; }
if(m/f6=(.*?)\&/i) { $f6=URLDecodeString($1); s/(f6=.*?\&)//i; $I11111111II11I11 .= $1; }
if(m/f7=(.*?)\&/i) { $f7=URLDecodeString($1); s/(f7=.*?\&)//i; $I11111111II11I11 .= $1; }
if(m/f8=(.*?)\&/i) { $f8=URLDecodeString($1); s/(f8=.*?\&)//i; $I11111111II11I11 .= $1; }
if(m/f9=(.*?)\&/i) { $f9=URLDecodeString($1); s/(f9=.*?\&)//i; $I11111111II11I11 .= $1; }
if(length($I11111111II11I11)>0)	 { $I11111111II11I11 = "&$I11111111II11I11";
} if(m/passurl=(.*?)$/i) { $I1IIII1I1I1I1I1I=$1; s/passurl=(.*?)$//i; }
$I1IIII1I1I1I1I1I =~ s/\&*$//; if(m/search=(.*?)\&/i) { $I1II11I111II1II1=$1; s/search=(.*?)\&//i; }
if(!$I1II11I111II1II1 && !$I1IIII1I1I1I1I1I) { $I1IIII1I1I1I1I1I = "/";
} $I1III11I11II1III=$_; if($I1IIII1I1I1I1I1I && $I1III1IIIII1I11I)
{ $I1I1I1III1III1I1 = "$I1IIII1I1I1I1I1I"; $I1I1I1III1III1I1 =~ s|(.*?)/*$|$1|g;
$I1I1III1I11II1I1 = 1; while($I1I1I1III1III1I1 =~ m|/|g) { $I1I1III1I11II1I1++;
} foreach $I1II1I111111IIII (@I111III11I11II11) { if($I1I1I1III1III1I1 =~ m|$I1II1I111111IIII|i)
{ $I11I111I11111I1I = 1; } } foreach $I1I11I111IIIIIII (@I111111II111IIII)
{ if($I1I1I1III1III1I1 =~ m|$I1I11I111IIIIIII|i) { $I11I111I11I1II11 = 1;
} } $I1I1I1III1III1I1 =~ s|[^\w\d]||igs; $I1I1I1III1III1I1 =~ s|_||igs;
$I1I1I1III1III1I1 = "$I1I1I11I1I11I111/AODP$I11II11IIIIIIIII.$I1I1III1I11II1I1$I1I1I1III1III1I1";
if(!$I11I111I11111I1I && ($I11I111I11I1II11 || ($I1I1III1I11II1I1>$I1III11III1I111I)))
{ $I1III1IIIII1I11I = 0; } } else { $I1III1IIIII1I11I = 0; } if ($I1III1IIIII1I11I  && (-e "$I1I1I1III1III1I1") && ((-M "$I1I1I1III1III1I1") < $I1II1I1I11II1111)) 
{  if($I1III1I111IIII1I) { $I1111I11I1II1I1I = "[opening... depth=$I1I1III1I11II1I1 cachefile=$I1I1I1III1III1I1]";	}
open(CACHEFILE, "$I1I1I1III1III1I1"); $I1I1III1111II1II = ""; while($I1I1I11II1111I1I=<CACHEFILE>) { $I1I1III1111II1II .= "$I1I1I11II1111I1I\n"; }
close CACHEFILE; if(!($I1I1III1111II1II =~ s|\[opening\.\.\.[^\]]*\]|$I1111I11I1II1I1I|gs))
{ $I1I1III1111II1II =~ s|\[fetching\.\.\.[^\]]*\]|$I1111I11I1II1I1I|gs; }
} else { $I1I1111II111I1I1 = $I1III1II111III1I; $I1I1111II111I1I1 .= $I11III11I11I1111?$I11III11I11I1111:$I11I1I1I1IIIII1I;
if(-s $I1I1111II111I1I1) { open(TEMPLATEFILE,$I1I1111II111I1I1);
while($I1I11I1111IIII11=<TEMPLATEFILE>) {	 while($I1I11I1111IIII11 =~ m/\<\!\-\-\s*\#INCLUDE\s+VIRTUAL=\"(.+)\"\s*\-\-\>/i)
{  open(INCFILE, "$I1III1II111III1I$1"); $I1I1I1II1IIII11I = ""; while($I1I1I11II1111I1I=<INCFILE>) { $I1I1I1II1IIII11I .= "$I1I1I11II1111I1I\n"; }
close INCFILE; $I1I11I1111IIII11 =~ s/\<\!\-\-\s*\#INCLUDE\s+VIRTUAL=\"(.+)\"\s*\-\-\>/$I1I1I1II1IIII11I/ig; 
} $I111II1III11IIII .= "$I1I11I1111IIII11\n";	 } } else { print "Anaconda Error - template file \"$I1I1111II111I1I1\" not found!\n";
} if($I111II1III11IIII =~ s|(.*?)<!--\s*ANACONDA| <!-- ANACONDA|is)
{ print $1; $I11II11111I1IIII = $1; } else { $I11II11111I1IIII = "";
} if($I1III1I111IIII1I) { $I1111I11I1II1I1I = "[fetching... depth=$I1I1III1I11II1I1 cachefile=$I1I1I1III1III1I1]";	}
if($I1IIII1I1I1I1I1I) { $I1II1II111II111I=$I1IIII1I1I1I1I1I; if ($I1II1II111II111I =~ m|netscape\?|i)
{ $I11I11III111I11I='google.netscape.com'; $I1II1II111II111I =~ m|.*?q=(.+?)&|;
$I1II11I1111IIIII=$1; } if ($I1II1II111II111I =~ m|cgi\-bin|i)
{ $I11I11III111I11I=$I1I1I1I1II1II11I; $I1II1II111II111I =~ m|.*?search=(.+?)&|;
$I1II11I1111IIIII=$1; } $I1II1II111II111I =~ s|http://([^/]*)$|/|i;
$I1II1II111II111I =~ s|http://(.*?)/|/|i; if($I1II1II111II111I =~ m|\?|)
{ $I11111I11IIII111 = $I1II1II111II111I; $I1II1II111II111I =~ s|\?(.*)$||i;
$I11111I11IIII111 =~ s|^.*\?(.*?)$|$1|; } else { $I1II1II111II111I =~ s|([^/])$|$1/|i;
$I1II1II111II111I =~ s|^([^/])|/$1|i; } $I1I1IIII1II1I1I1 = &HTTPGet("$I1II1II111II111I", "$I11I11III111I11I", 80, "$I11111I11IIII111");
}		 else { if($I1I1I11111111III && $I1II11I111II1II1) { open(logfile1,">>$I1I1I11111111III");
$I1I1III1III1IIII = $I1II11I111II1II1; $I1I1III1III1IIII =~ s/^[=\+]+//; while ($I1I1III1III1IIII =~ s/\+/ /) { };
print logfile1 "$I1I1III1III1IIII\n";  close logfile1;  } $I1II1II1III1I1I1 = 1;
$I11111I11IIII111=$I1III11I11II1III; $I1II1II111II111I="/cgi-bin/search";
$I11I11III111I11I=$I1I1I1I1II1II11I; $I11111I11IIII111 = "search=$I1II11I111II1II1\&$I1III11I11II1III";
$I1II11I1111IIIII = $I1II11I111II1II1; $I1I1IIII1II1I1I1 = &HTTPGet("$I1II1II111II111I", "$I11I11III111I11I", 80, "$I11111I11IIII111");
} if ($I1I1IIII1II1I1I1 =~ m#Location: http://(.+?)/(.+)$#m)	
{  @I1II11I1IIII1111 = split(/\?/, $2); $I1I1IIII1II1I1I1=&HTTPGet("/$I1II11I1IIII1111[0]", "$1", 80, "$I1II11I1IIII1111[1]"); 
}  if ($I1I1IIII1II1I1I1 =~ m#Location: http://(.+?)/(.+)$#m)	
{  @I1II11I1IIII1111 = split(/\?/, $2); $I1I1IIII1II1I1I1=&HTTPGet("/$I1II11I1IIII1111[0]", "$1", 80, "$I1II11I1IIII1111[1]"); 
}	 $I1IIIII1II1I111I=0; $I111I1III11I1I1I=0; if(!$I1I11I1I11I11II1)
{ $I1I11I1I11I11II1 = "Top"; $I1I111II1II11111 = "$I11I1II11III1I11?passurl=/";
} if(!$I11II11IIIIIIIII) { if($I1I1IIII1II1I1I1 =~ m|value=no>Search only in <b>([^<]*)</b>|is)
{ $I1II1II1II1II111 = "$1"; }	 if($I1I1IIII1II1I1I1 =~ m|name=cat value=\"([^\"]*)\">|is)
{ $I11IIIII1111I1II = "$1"; }	 $I111III1111111I1 = qq|<a href="$I1I111II1II11111">$I1I11I1I11I11II1</a> \&gt\; |;
if($I1II1II111II111I eq '/') { $I1I1IIII1II1I1I1 =~ s|^.*?/cgi-bin/search.*?<TABLE|<TABLE|is;
$I1I1IIII1II1I1I1 =~ s|</table>.*$|</table>|is; $I111III1111111I1="";
} else { if($I1I1IIII1II1I1I1 =~ m|(<B>Search Results for.*?</B>)|is)
{ $I11I111111I1II11 = $1; } if($I1I1IIII1II1I1I1 =~ s|.*?<\!----\*\*BEGIN MIDDLE COLUMN\*\*---->(.*?)<\!---- START SEARCH TABLE ---->.*$|$1|is)
{ $I1I1IIII1II1I1I1 = "<TABLE><TR>$I1I1IIII1II1I1I1</td></tr></table></td></tr></table>";
} if($I1I1IIII1II1I1I1 =~ s|<!-- E4:START:NAV_BAR -->.*?Netscape Search</A>&nbsp;&gt; (.*)<!-- E4:END:NAV_BAR -->||is)
{ $I11I111111I1II11 = "$1"; } $I1I1IIII1II1I1I1 =~ s|^.*<!----END SEARCH TABLE---->||is;
$I1I1IIII1II1I1I1 =~ s|<!-- footer -->.*<!-- end footer -->||is;
$I1I1IIII1II1I1I1 =~ s|<TABLE WIDTH=600.*?Search Categories.*?</table>||is;
$I1I1IIII1II1I1I1 =~ s|<!---- START SEARCH TABLE ---->.*$||is;
}	 if($I11III1III1111I1) { $I1I1IIII1II1I1I1 =~ s|>Category editors:<|><|igs;
$I1I1IIII1II1I1I1 =~ s|<A [^>]*/profiles/[^>]*>[^<]*</a>,?||igs;
} $I1I1IIII1II1I1I1 =~ s|http://directory.netscape.com||igs; $I1I1IIII1II1I1I1 =~ s|href=\"/(.*?)\"|href=\"$I11I1II11III1I11\?passurl=/$1$I11111111II11I11"|igs;
$I1I1IIII1II1I1I1 =~ s|href=\"search\?(.*?)\"|href=\"$I11I1II11III1I11\?passurl=/cgi-bin/search\?$1$I11111111II11I11"|igs;
$I1I1IIII1II1I1I1 =~ s|href=(\"?)/?netscape\?(.*?)([\">])|href=$1$I11I1II11III1I11\?passurl=/netscape\?$2$I11111111II11I11$3|igs;
$I1I1IIII1II1I1I1 =~ s|=\"/([^"]*?)\.gif\"|=\"http://$I11I11III111I11I/$1\.gif\"|igs;
$I1I1IIII1II1I1I1 =~ s|=\"/([^"]*?)\.jpg\"|=\"http://$I11I11III111I11I/$1\.jpg\"|igs;
$I1I1IIII1II1I1I1 =~ s/<img (.*?) src="\/(.*?)"/<img $1 src="http:\/\/$I11I11III111I11I\/$2"/igs;
$I1I1IIII1II1I1I1 =~ s/<img(.*?)src=\/(.*?) /<img $1 src="http:\/\/$I11I11III111I11I\/$2" /igs;
$I1I1IIII1II1I1I1 =~ s|href=\"$I11I1II11III1I11\?passurl=/profiles/|target=\"_self\" href=\"http://$I11I11III111I11I/profiles/|ig;
if($I11I1111II1I11I1) { $I1I1IIII1II1I1I1 =~ s|href=\"|target=\"_self\" href=\"|igs; 
$I1I1IIII1II1I1I1 =~ s|target=\"_self\" href=\"$I11I1II11III1I11\?passurl|href=\"$I11I1II11III1I11\?passurl|igs; 
$I1I1IIII1II1I1I1 =~ s|target=\"_self\" href=\"http://dmoz.org|href=\"http://dmoz.org|igs;
}  $I11I111111I1II11 =~ s|http://directory.netscape.com||igs;
$I11I111111I1II11 =~ s|href=\"/(.*?)\"|href=\"$I11I1II11III1I11\?passurl=/$1$I11111111II11I11"|igs;	
if($I1II1II111II111I ne '/')	 { $I111I11I11IIII1I = "<b><font size=+1>$I111III1111111I1$I11I111111I1II11</font></b><BR><BR>";
} $I11III1111I111I1 = qq|<div align="center"><TABLE><TR><TD><div align="center">$I1I1IIII1II1I1I1</div></td></tr></table></div>|;
} else { if($I1I1IIII1II1I1I1 =~ m|value\=no>only in <b>([^<]*)</b>|is)
{ $I1II1II1II1II111 = "$1"; }	 if($I1I1IIII1II1I1I1 =~ m|name=cat value=\"([^\"]*)\">|is)
{ $I11IIIII1111I1II = "$1"; }	 if($I1I1IIII1II1I1I1 =~ m|Microsoft_Encarta|)
{ $I1I1IIII1II1I1I1 =~ s|<hr>.<ul>(.+?)</ul><hr>|<ENCARTA>|is;
$I1III11IIIIII11I = "<hr><ul>\n$1\n</ul><hr>"; } if(!$I11III1III1111I1 && $I1I1IIII1II1I1I1 =~ m|Category editor|)
{ $I1I1IIII1II1I1I1 =~ s|<table bgcolor=\"#f0f0f0\">(.*?)Category editor(.*?)</table></td></tr></table>||is;
$I1II1II1I111II1I = qq|<div align=\"center\"><table bgcolor=\"#f0f0f0\">$1Category editor$2</table></td></tr></table></div>|;
if($I1IIIIII11II1III) { $I1II1II1I111II1I =~ s|<img[^<>]*?online.mirabilis.com[^<>]*?>||igs;
} } if($I1II1I111I1IIII1) { $I1I1IIII1II1I1I1 =~ s|<b>Open Directory Categories</b>|<b>$I1II1I111I1IIII1</b>|igs;
} if($I1II1I11I111I1I1) { $I1I1IIII1II1I1I1 =~ s|<b>Open Directory Sites</b>|<b>$I1II1I11I111I1I1</b>|igs;
} $I1I1IIII1II1I1I1 =~ s|^(.*?)</table>||is; $I1I1IIII1II1I1I1 =~ s|^(.*?)opendir\.gif(.*?)</a></center>||igs;
$I1I1IIII1II1I1I1 =~ s|^(.*?)opendir\.gif(.*?)<p>||igs; $I1I1IIII1II1I1I1 =~ s|<form(.*?)>||igs;
$I1I1IIII1II1I1I1 =~ s|<select(.*?)</select>||igs; $I1I1IIII1II1I1I1 =~ s|<input(.*?)>||igs;
$I1I1IIII1II1I1I1 =~ s|</form>||igs; $I1I1IIII1II1I1I1 =~ s|width=600||igs;
$I1I1IIII1II1I1I1 =~ s|width=\"600\"||igs; $I1I1IIII1II1I1I1 =~ s|<SMALL>([^>]*?)>Help on Search</A></SMALL>||igs;
$I1I1IIII1II1I1I1 =~ s|<A([^>]*?)>Help on Search</A>||igs; $I1I1IIII1II1I1I1 =~ s|-([^>]*?)>advanced search</a>||igs;
$I1I1IIII1II1I1I1 =~ s|-([^>]*?)>advanced</a>||igs; $I1I1IIII1II1I1I1 =~ s|<form(.*?)</form>||igs;
$I1I1IIII1II1I1I1 =~ s|<A NAME\=top></A>|\n<A NAME\=top></A>\n|igs;
$I1I1IIII1II1I1I1 =~ s|<a href=\"desc.html\">Description</a>||igs;
$I1I1IIII1II1I1I1 =~ s|<a href=\"faq.html\">FAQ</a>||igs; $I1I1IIII1II1I1I1 =~ s|<TABLE CELLPADDING="5" CELLSPACING="2"(.*?)</TABLE>||s;
$I1I1IIII1II1I1I1 =~ s|<table bgcolor=\"#ffffcc\"(.*?)</table>||igs;
$I1I1IIII1II1I1I1 =~ s|<table bgcolor=\"#f0f0f0\"(.*?)</table>||igs;
$I1I1IIII1II1I1I1 =~ s|<table bgcolor=\"#ccccff\"(.*?)</table>||igs;
$I1I1IIII1II1I1I1 =~ s|<table bgcolor=\"#cccccc\"(.*?)</table>||igs;
$I1I1IIII1II1I1I1 =~ s|<table border=0 bgcolor=\"#669933\"(.*?)</table>||igs;
$I1I1IIII1II1I1I1 =~ s|No <b><a href=\"http://dmoz.org/\">Open Directory Project</a></b> results found|No results found|igs;
if($I1IIII1I1I1I1I1I eq "/") { $I1I1IIII1II1I1I1 =~ s|^(.*?)<table cellspacing="4" cellpadding="4">|<table cellspacing="4" cellpadding="4">|is;
$I1I1IIII1II1I1I1 =~ s|</table>(.*?)$|</table>|is; } elsif($I1I1IIII1II1I1I1 =~ m|<hr>|i)
{ @I11II11I1IIII111=split(/(<hr>)/i, $I1I1IIII1II1I1I1); $#I11II11I1IIII111--;
$I1I1IIII1II1I1I1 = join('', @I11II11I1IIII111); } $I1I1IIII1II1I1I1 =~ s|<ENCARTA>|$I1III11IIIIII11I|is;
$I1I1IIII1II1I1I1 .= $I1II1II1I111II1I; $I111I1111I11I1I1 = $I1I1IIII1II1I1I1;
foreach $I11I111IIII111II (split(/\n/, $I111I1111I11I1I1))  {
$_=$I11I111IIII111II;	 s|=\"/([^"]*?)\.gif\"|=\"http://$I11I11III111I11I/$1\.gif\"|ig;
s|=\"/([^"]*?)\.jpg\"|=\"http://$I11I11III111I11I/$1\.jpg\"|ig;
s/<img (.*?) src="\/(.*?)"/<img $1 src="http:\/\/$I11I11III111I11I\/$2"/ig;
s/<img(.*?)src=\/(.*?) /<img $1 src="http:\/\/$I11I11III111I11I\/$2" /ig;
if (m|<a href=\"/about.html\"><b>Become an Editor|i)  { s|href=\"/about.html\"|href=\"http://$I11I11III111I11I/about.html"|ig;
} elsif (m|cgi-bin/apply\.cgi|i)  { s|href=\"/cgi-bin/apply.cgi\?(.*?)\"|href=\"http://$I11I11III111I11I/cgi-bin/apply.cgi\?$1"|ig;
} else {   s|href=\"/(.*?)\"|href=\"$I11I1II11III1I11\?passurl=/$1$I11111111II11I11"|ig;
s|href=\"([^\.\/]+?)\?(.*?)\"|href=\"$I11I1II11III1I11\?passurl=/cgi-bin/$1\?$2$I11111111II11I11"|ig;
s|href=\"http://dmoz.org/(.*?)\"|href=\"$I11I1II11III1I11\?passurl=/$1$I11111111II11I11"|ig;
s|href=\"http://search.dmoz.org/(.*?)\"|href=\"$I11I1II11III1I11\?passurl=/$1$I11111111II11I11"|ig;
s|href=\"$I11I1II11III1I11\?passurl=/profiles/|target=\"_self\" href=\"http://$I11I11III111I11I/profiles/|ig;
} if($I11I1111II1I11I1) { s|href=\"|target=\"_self\" href=\"|ig; 
s|target=\"_self\" href=\"$I11I1II11III1I11\?passurl|href=\"$I11I1II11III1I11\?passurl|ig; 
}  $I11III1111I111I1 .= "$_\n"; } if($I1II1II1111111I1) { $I11III1111I111I1 =~ s|<hr>|\¤|igs;
$I11III1111I111I1 =~ s|\¤[^\¤]*?>AltaVista</a>[^\¤]*?\¤|<hr>|igs;
$I11III1111I111I1 =~ s|\¤|<hr>|igs; } $I11III1111I111I1 =~ s|<td|\¤|igs;
$I11III1111I111I1 =~ s|</td>|\¿|igs; if($I11III1111I111I1 =~ s|\¤[^>]*>([^\¿\¤]*>Top</a>:[^\¿\¤]*)\¿|<TD></td>|is)
{ $I111I11I11IIII1I = "$1"; $I111I11I11IIII1I =~ s|<a href=\"([^\"]*?)\">Top</a>:|<a href=\"$I1I111II1II11111\">$I1I11I1I11I11II1</a>:|igs;
} $I11III1111I111I1 =~ s|\¤|<TD|igs; $I11III1111I111I1 =~ s|\¿|</td>|igs;
} $I111I1111I11I1I1 = qq|$I11III1111I111I1|; if($I11IIIII1111I1II)
{ $I11I1I1III1I11I1 = qq|<form method=get action=\"$I11I1II11III1I11\"><input size=30 name=search> <input type=submit value=Search>|
. qq|<small><br><input type=radio name=all value=yes checked>Search all categories &nbsp;<input type=radio name=all value=no>Search only in <b>$I1II1II1II1II111</b>|
. qq|</small><input type=hidden name=cat value=\"$I11IIIII1111I1II\"></form>|;
} else { $I11I1I1III1I11I1 = qq|<form method=get action=\"$I11I1II11III1I11\"><input size=30 name=search> <input type=submit value=Search></form>|;
}	 if($I11II11IIIIIIIII && $I11IIIII1111I1II) { $I111I1111I11I1I1 .= qq|<div align="center"><BR><p><table border="0" bgcolor="#336600" cellpadding="3" cellspacing="0"><tr><td><table width="100%" cellpadding="2" cellspacing="0" border="0">|
. qq|<tr align="center"><td><font face="sans-serif, Arial, Helvetica" size="2" color="#FFFFFF">Help build the largest human-edited directory on the web.</font></td></tr>|
. qq|<tr bgcolor="#CCCCCC" align="center"><td><font face="sans-serif, Arial, Helvetica" size="2"> <a href="http://dmoz.org/cgi-bin/add.cgi?where=$I11IIIII1111I1II">Submit a Site</a> - |
. qq|<a href="http://dmoz.org/about.html"><b>Open Directory Project</b></a> - <a href="http://dmoz.org/cgi-bin/apply.cgi?where=$I11IIIII1111I1II">Become an Editor</a> </font>|
. qq|</td></tr></table></td></tr></table></div>|; }	 $I111I1111I11I1I1 .= "<BR><CENTER><font face=\"Arial\" size=\"-2\">Open Directory results by <A target=\"_self\" HREF=\"http://www.anaconda.net\">Anaconda!</A></FONT></CENTER>\n";
if($I111I1111I11I1I1 =~ m|Search results for: <B>([^<>]*?)</B>|igms)
{ $I1II11I1111IIIII = $1; } elsif($I111I1111I11I1I1 =~ m|Search: <B>(.*?)</B>|igms)
{ $I1II11I1111IIIII = $1; } elsif($I11I111111I1II11 =~ m|;([.\w\s]+)$|s)
{ $I1II11I1111IIIII = $1; } elsif($I11I111111I1II11 =~ m|^([\w\s]+)$|s)
{ $I1II11I1111IIIII = $1; } elsif($I111I11I11IIII1I =~ m|Top(.*?):\s([^:]*?)</b></font>|igms)
{ $I1II11I1111IIIII = $2; }	 elsif($I111I11I11IIII1I =~ m|$I1I11I1I11I11II1(.*?):\s([^:]*?)</b></font>|igms)
{ $I1II11I1111IIIII = $2; }	 $I1I1I11I1I11III1 = $I1II11I1111IIIII;
$I1I1I11I1I11III1 =~ s|\s+|+|igs; if($I1II111111IIII1I || $I1II1II1111II1I1)
{ if ($I1II111111IIII1I == 1) { $I1II11111IIII11I .= qq|<table bgcolor="#000000" border=0 cellpadding=1 cellspacing=0 hspace=2 vspace=2>|;
$I1II11111IIII11I .= qq|<tr><td><table border=0 cellpadding=3 cellspacing=0><tr align=center>|;
$I1II11111IIII11I .= qq|<td bgcolor="#ffffcc"><small><b>Search Books</b><br>|;
$I1II11111IIII11I .= qq|<A target="_self" HREF="$I1II11I1II11III1?tag=$I11I1I1I1I11III1&keyword=$I1I1I11I1I11III1">$I1II11I1111IIIII</a></small></td></tr><tr align=center><td bgcolor="#ffffcc">|;
if ($I1II1I1111II1II1) { $I1II11111IIII11I .= qq|<A target="_self" HREF="$I1II11I1II11III1?tag=$I11I1I1I1I11III1&keyword=$I1I1I11I1I11III1"><IMG SRC="$I1II1I1111II1II1" height="31" width="88" border=0 alt="Buy a book now!"></A>|;
} else { $I1II11111IIII11I .= qq|<b>Amazon.com</b>|; } $I1II11111IIII11I .= qq|</td></tr></table></td></tr></table>|;
} if ($I1II1II1111II1I1 == 1) { $I1II11111IIII11I .= qq|<table bgcolor="#000000" border=0 cellpadding=1 cellspacing=0 hspace=2 vspace=2>|;
$I1II11111IIII11I .= qq|<tr><td><table border=0 cellpadding=3 cellspacing=0><tr align=center>|;
$I1II11111IIII11I .= qq|<td bgcolor="#ffffcc"><small><b>Search Books</b><br>|;
$I1II11111IIII11I .= qq|<A target="_self" HREF="$I1II11I1III11I11?sourceid=$I1I111I1I11III1I&is_search=Y&match=exact&options=and&keyword=$I1I1I11I1I11III1">$I1II11I1111IIIII</a></small></td></tr><tr align=center><td bgcolor="#ffffcc">|;
if ($I1IIII1IIII11I11) { $I1II11111IIII11I .= qq|<A target="_self" HREF="$I1II11I1III11I11?tag=$sourceid=$I1I111I1I11III1I&is_search=Y&match=exact&options=and&keyword=$I1I1I11I1I11III1"><IMG SRC="$I1IIII1IIII11I11" height="31" width="88" border=0 alt="Buy a book now!"></A>|;
} else { $I1II11111IIII11I .= qq|<b>Barnes and Noble</b>|; } $I1II11111IIII11I .= qq|</td></tr></table></td></tr></table>|;
} if($I1II1111IIII111I) {} else { $I1II11111IIII11I =~ s|target="_self"||igs;
} if($I1II11I1111IIIII) {} else { $I1II11111IIII11I = ""; } }
$I1I1III1111II1II = ""; foreach $I1I11I1111IIII11 (split(/\n/, $I111II1III11IIII))
{ $I1I11I1111IIII11 =~ s/\<\!\-\-\s*ANACONDARESULTS\s*\-\-\>/$I111I1111I11I1I1/;
$I1I11I1111IIII11 =~ s/\<\!\-\-\s*ANACONDATIME\s*\-\-\>/$I111I1111I1II111/;
$I1I11I1111IIII11 =~ s/\<\!\-\-\s*ANACONDASEARCH\s*\-\-\>/$I11I1I1III1I11I1/gm;
$I1I11I1111IIII11 =~ s/\<\!\-\-\s*ANACONDANAV\s*\-\-\>/$I111I11I11IIII1I/gm;
$I1I11I1111IIII11 =~ s/\<\!\-\-\s*ANACONDAKEYWORD\s*\-\-\>/$I1II11I1111IIIII/gm;
$I1I11I1111IIII11 =~ s/\<\!\-\-\s*ANACONDAKEYWORDX\s*\-\-\>/$I1I1I11I1I11III1/gm;
$I1I11I1111IIII11 =~ s/\<\!\-\-\s*ANACONDABOOKLINK\s*\-\-\>/$I1II11111IIII11I/gm;
$I1I11I1111IIII11 =~ s/\<\!\-\-\s*ANACONDAF1\s*\-\-\>/$f1/gm;
$I1I11I1111IIII11 =~ s/\<\!\-\-\s*ANACONDAF2\s*\-\-\>/$f2/gm;
$I1I11I1111IIII11 =~ s/\<\!\-\-\s*ANACONDAF3\s*\-\-\>/$f3/gm;
$I1I11I1111IIII11 =~ s/\<\!\-\-\s*ANACONDAF4\s*\-\-\>/$f4/gm;
$I1I11I1111IIII11 =~ s/\<\!\-\-\s*ANACONDAF5\s*\-\-\>/$f5/gm;
$I1I11I1111IIII11 =~ s/\<\!\-\-\s*ANACONDAF6\s*\-\-\>/$f6/gm;
$I1I11I1111IIII11 =~ s/\<\!\-\-\s*ANACONDAF7\s*\-\-\>/$f7/gm;
$I1I11I1111IIII11 =~ s/\<\!\-\-\s*ANACONDAF8\s*\-\-\>/$f8/gm;
$I1I11I1111IIII11 =~ s/\<\!\-\-\s*ANACONDAF9\s*\-\-\>/$f9/gm;
$I1I11I1111IIII11 =~ s/\<\!\-\-\s*ANACONDADEBUG\s*\-\-\>/$I1111I11I1II1I1I/gm;
$I1I11I1111IIII11 =~ s/\<\!\-\-\s*ANACONDASITECODE\s*\-\-\>/$I111I11III11I111/gm;
$I1I11I1111IIII11 =~ s/\<\!\-\-\s*TEMPLATE\s*\-\-\>/$I11III11I11I1111/gm;
while($I1I11I1111IIII11 =~ s|<!-- ANACONDARANDOMLINE=\"(.+?)\" -->|_ANACONDAREPLACE $I11I1111II1II1I1 _|i)
{  open(INCFILE, "$1"); srand; rand($.) < 1 && ($I1I1I1111IIII1I1 = $_) while <INCFILE>; 
close INCFILE; $I111I1I11IIIII1I[$I11I1111II1II1I1] = $I1I1I1111IIII1I1;
$I11I1111II1II1I1++; } $I11I1111II1II1I1 = 0; while($I1I11I1111IIII11 =~ m|_ANACONDAREPLACE $I11I1111II1II1I1 _|gm)
{ $I1I11I1111IIII11 =~ s|_ANACONDAREPLACE $I11I1111II1II1I1 _|$I111I1I11IIIII1I[$I11I1111II1II1I1]|igs; 
$I11I1111II1II1I1++; } $I1I1III1111II1II .= "$I1I11I1111IIII11\n"; 
} if ($I1III1IIIII1I11I) { open(WCACHEFILE, ">$I1I1I1III1III1I1"); 
print WCACHEFILE $I11II11111I1IIII; print WCACHEFILE $I1I1III1111II1II;
close WCACHEFILE; }	 } print "$I1I1III1111II1II\n"; exit; sub InitStuff
{ $I111I1111I1II111 = time(); $I11111IIIIII1I11 = "\015\012";
$I1II11I11I1III1I=0; $I1II1II11IIIII1I=""; if($AP_use_LWP) { require LWP::UserAgent;
$useLWP=1; } elsif($AP_use_original) {	 } else { require IO::Socket;
} } sub HTTPGet  { local($I111IIIII1I11111, $I1111IIII1I1III1, $I11II1IIII1I111I, $I1III1II11II1II1) = @_;
local ($I1I1I11IIII1III1et); $I1I1I11IIII1III1et = HTTPPreFetch($I111IIIII1I11111, $I1111IIII1I1III1, $I11II1IIII1I111I, $I1III1II11II1II1, "GET");
return HTTPPostFetch($I1I1I11IIII1III1et, $I111IIIII1I11111, $I1111IIII1I1III1, $I11II1IIII1I111I, $I1III1II11II1II1, "GET");
}	 sub HTTPPost  { local($I111IIIII1I11111, $I1111IIII1I1III1, $I11II1IIII1I111I, $I1III1II11II1II1) = @_;
local ($I1I1I11IIII1III1et); $I1I1I11IIII1III1et = HTTPPreFetch($I111IIIII1I11111, $I1111IIII1I1III1, $I11II1IIII1I111I, $I1III1II11II1II1, "POST");
return HTTPPostFetch($I1I1I11IIII1III1et, $I111IIIII1I11111, $I1111IIII1I1III1, $I11II1IIII1I111I, $I1III1II11II1II1, "POST");
}	 sub HTTPPreFetch  { local($I111IIIII1I11111, $I1111IIII1I1III1, $I11II1IIII1I111I, $I1III1II11II1II1, $I1111II111I11II1) = @_;
local($I1I1I11IIII1III1et, $I11IIII111I11I1I); if($useLWP) { return 0;
} else { $I1I1I11IIII1III1et = &new_socket($I1111IIII1I1III1, $I11II1IIII1I111I, $I1II111111111I1I);
$I11IIII111I11I1I = &FormatFormVars($I1III1II11II1II1); if($I1111II111I11II1 eq 'GET')
{ $I111IIIII1I11111 .= "?" . $I11IIII111I11I1I; print  $I1I1I11IIII1III1et "GET $I111IIIII1I11111 HTTP/1.0$I11111IIIIII1I11";
print  $I1I1I11IIII1III1et "Accept: text/html$I11111IIIIII1I11";
print  $I1I1I11IIII1III1et "Accept: text/plain$I11111IIIIII1I11";
print  $I1I1I11IIII1III1et "User-Agent: Mozilla/4.0$I11111IIIIII1I11";
print  $I1I1I11IIII1III1et "$I11111IIIIII1I11"; print  $I1I1I11IIII1III1et "$I11111IIIIII1I11";
} else { $I11IIII1I1II111I = length($I11IIII111I11I1I); print  $I1I1I11IIII1III1et "POST $I111IIIII1I11111 HTTP/1.0$I11111IIIIII1I11";
print  $I1I1I11IIII1III1et "Accept: text/html$I11111IIIIII1I11";
print  $I1I1I11IIII1III1et "Accept: text/plain$I11111IIIIII1I11";
print  $I1I1I11IIII1III1et "User-Agent: Mozilla/4.0$I11111IIIIII1I11";
print  $I1I1I11IIII1III1et "Content-type: application/x-www-form-urlencoded$I11111IIIIII1I11";
print  $I1I1I11IIII1III1et "Content-length: $I11IIII1I1II111I$I11111IIIIII1I11";
print  $I1I1I11IIII1III1et "$I11111IIIIII1I11"; print  $I1I1I11IIII1III1et "$I11IIII111I11I1I$I11111IIIIII1I11";
} } return $I1I1I11IIII1III1et; } sub HTTPPostFetch  { local($I1I1I11IIII1III1et, $I111IIIII1I11111, $I1111IIII1I1III1, $I11II1IIII1I111I, $I1III1II11II1II1, $I1111II111I11II1) = @_;
local($I11IIII111I11I1I, $I1I111111II11111); local ($I11I1II1I111I11I);
if($useLWP) { if($I1111II111I11II1 eq 'GET') { $I11II1I1111I1II1 = new LWP::UserAgent;
$I11II1I1111I1II1->agent('Mozilla/4.0'); $I111IIIII1I11111 =~ s|^/||;
my $I1IIIII1II1111II = new HTTP::Request 'GET',"http://$I1111IIII1I1III1/$I111IIIII1I11111?$I1III1II11II1II1";
my $I11IIII11111II11 = $I11II1I1111I1II1->request($I1IIIII1II1111II);
$I11I1II1I111I11I=$I11IIII11111II11->as_string; } else { $I11II1I1111I1II1 = new LWP::UserAgent;
$I11II1I1111I1II1->agent('Mozilla/4.0'); my $I1IIIII1II1111II = new HTTP::Request 'POST',"http://$I1111IIII1I1III1$I111IIIII1I11111";
$I1IIIII1II1111II->content_type('application/x-www-form-urlencoded');
$I1IIIII1II1111II->content("$I1III1II11II1II1"); my $I11IIII11111II11 = $I11II1I1111I1II1->request($I1IIIII1II1111II);
$I11I1II1I111I11I=$I11IIII11111II11->as_string; } } else { $I11I1II1I111I11I = &RetrieveHTTP($I1I1I11IIII1III1et);
} if(length($I11I1II1I111I11I)==0)	 {  $I1II111I11IIIIII++;  }
$I11I1II1I111I11I; } sub FormatFormVars { local ($I1III1II11II1II1) = @_; 
$I1III1II11II1II1 =~ s/ /%20/g; $I1III1II11II1II1; }  sub RetrieveHTTP 
{ local ($I1I1I11IIII1III1et) = @_; local ($I11I1II1I111I11I,$I1I111111II11111, $I11III111I1II1I1);
local($I1II1I11I11I111I, $I1II111II1II1II1); $I11I1II1I111I11I = read_sock($I1I1I11IIII1III1et, $I1II111111111I1I);
while($I1II1I11I11I111I = sysread($I1I1I11IIII1III1et, $I1II111II1II1II1, 1024))
{ $I11I1II1I111I11I .= $I1II111II1II1II1; } close $I1I1I11IIII1III1et;
$I11I1II1I111I11I; } sub read_sock  { local($I1IIIIII1111I11I, $I11I11I1111I11I1) = @_;
local($I1II111II1II1II1,$I11I1II1I111I11I); local($I111I1IIII111111,$I11111I11I1II1I1,$I1II1I1111I1II11);
$I11I11I1111I11I1 += time; $I11I1II1I111I11I = ""; $I111I1IIII111111 = '';
vec($I111I1IIII111111, fileno($I1IIIIII1111I11I), 1) = 1; $I1II1I1111I1II11 = 0;
read_socket:  while (($I11I11I1111I11I1 > time) && ($I1II1I1111I1II11 <= 0)) 
{ $I1II1I11I11I111I = 1024; $I1II111II1II1II1 = " " x 1025; $I1II1I1111I1II11 = 1;
if ($I1II11I1I1111III ne "NT")  { $I1II1I1111I1II11 = select($I11111I11I1II1I1=$I111I1IIII111111, undef, undef,.2);
} } if ($I1II1I1111I1II11 > 0)  { $I1II1I11I11I111I = sysread($I1IIIIII1111I11I, $I1II111II1II1II1, 1024);
if ($I1II1I11I11I111I > 0)  { $I11I1II1I111I11I .= $I1II111II1II1II1;
} } $I11I1II1I111I11I; } sub URLDecodeString { my($I111IIIII1I11I1I) = shift;
$I111IIIII1I11I1I =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
return $I111IIIII1I11I1I; } sub new_socket { my($I11I11I111II111I, $I11II1IIII1I111I, $I1II111I11IIIIII) = @_;
my($I1I1I11IIII1III1); if($AP_use_original) { my $I111IIII1II11III = gethostbyname('localhost');
my $PROTOCOL = getprotobyname('tcp'); my $SOCK_STREAM = SOCK_STREAM;
my $AF_INET = AF_INET; my $I1111II111111III = sockaddr_in(0, $I111IIII1II11III);
my $I11III1III1I111I = inet_aton($I11I11I111II111I)     || die "unknown host";
my $I11I1IIIIII1III1 = sockaddr_in($I11II1IIII1I111I, $I11III1III1I111I);
$I1II11I11I1III1I++; if($I1II11I11I1III1I == 1) { $t = socket (S1, $AF_INET, $SOCK_STREAM, $PROTOCOL) || &web_error( "$t Can't make socket:$!\n"); $I1II1III111I11II = S1; }
elsif ($I1II11I11I1III1I == 2) { socket (S2, $AF_INET, $SOCK_STREAM, $PROTOCOL) || &web_error( "Can't make socket:$!\n"); $I1II1III111I11II = S2; }
elsif ($I1II11I11I1III1I == 3) { socket (S3, $AF_INET, $SOCK_STREAM, $PROTOCOL) || &web_error( "Can't make socket:$!\n"); $I1II1III111I11II = S3; }
elsif ($I1II11I11I1III1I == 4) { socket (S4, $AF_INET, $SOCK_STREAM, $PROTOCOL) || &web_error( "Can't make socket:$!\n"); $I1II1III111I11II = S4; }
elsif ($I1II11I11I1III1I == 5) { socket (S5, $AF_INET, $SOCK_STREAM, $PROTOCOL) || &web_error( "Can't make socket:$!\n"); $I1II1III111I11II = S5; }
elsif ($I1II11I11I1III1I == 6) { socket (S6, $AF_INET, $SOCK_STREAM, $PROTOCOL) || &web_error( "Can't make socket:$!\n"); $I1II1III111I11II = S6; }
elsif ($I1II11I11I1III1I == 7) { socket (S7, $AF_INET, $SOCK_STREAM, $PROTOCOL) || &web_error( "Can't make socket:$!\n"); $I1II1III111I11II = S7; }
elsif ($I1II11I11I1III1I == 8) { socket (S8, $AF_INET, $SOCK_STREAM, $PROTOCOL) || &web_error( "Can't make socket:$!\n"); $I1II1III111I11II = S8; }
elsif ($I1II11I11I1III1I == 9) { socket (S9, $AF_INET, $SOCK_STREAM, $PROTOCOL) || &web_error( "Can't make socket:$!\n"); $I1II1III111I11II = S9; }
elsif ($I1II11I11I1III1I == 10) { socket (S10, $AF_INET, $SOCK_STREAM, $PROTOCOL) || &web_error( "Can't make socket:$!\n"); $I1II1III111I11II = S10; }
elsif ($I1II11I11I1III1I == 11) { socket (S11, $AF_INET, $SOCK_STREAM, $PROTOCOL) || &web_error( "Can't make socket:$!\n"); $I1II1III111I11II = S11; }
elsif ($I1II11I11I1III1I == 12) { socket (S12, $AF_INET, $SOCK_STREAM, $PROTOCOL) || &web_error( "Can't make socket:$!\n"); $I1II1III111I11II = S12; }
elsif ($I1II11I11I1III1I == 13) { socket (S13, $AF_INET, $SOCK_STREAM, $PROTOCOL) || &web_error( "Can't make socket:$!\n"); $I1II1III111I11II = S13; }
elsif ($I1II11I11I1III1I == 14) { socket (S14, $AF_INET, $SOCK_STREAM, $PROTOCOL) || &web_error( "Can't make socket:$!\n"); $I1II1III111I11II = S14; }
elsif ($I1II11I11I1III1I == 15) { socket (S15, $AF_INET, $SOCK_STREAM, $PROTOCOL) || &web_error( "Can't make socket:$!\n"); $I1II1III111I11II = S15; }
elsif ($I1II11I11I1III1I == 16) { socket (S16, $AF_INET, $SOCK_STREAM, $PROTOCOL) || &web_error( "Can't make socket:$!\n"); $I1II1III111I11II = S16; }
elsif ($I1II11I11I1III1I == 17) { socket (S17, $AF_INET, $SOCK_STREAM, $PROTOCOL) || &web_error( "Can't make socket:$!\n"); $I1II1III111I11II = S17; }
elsif ($I1II11I11I1III1I == 18) { socket (S18, $AF_INET, $SOCK_STREAM, $PROTOCOL) || &web_error( "Can't make socket:$!\n"); $I1II1III111I11II = S18; }
elsif ($I1II11I11I1III1I == 19) { socket (S19, $AF_INET, $SOCK_STREAM, $PROTOCOL) || &web_error( "Can't make socket:$!\n"); $I1II1III111I11II = S19; }
else { die "Can't create another socket!"; } connect($I1II1III111I11II, $I11I1IIIIII1III1) || die( "Can't connect socket:$!\n");
$I1I1I11IIII1III1=$I1II1III111I11II; } else { local($^W) = 0;
$I1I1I11IIII1III1 = IO::Socket::INET->new(PeerAddr => $I11I11I111II111I,
PeerPort => 'http(80)', Proto    => 'tcp', Timeout  => $I1II111I11IIIIII,
); unless ($I1I1I11IIII1III1) { die "Can't connect to $I11I11I111II111I:$I11II1IIII1I111I ($@)";
} } my $I111III111I1IIII = select($I1I1I11IIII1III1); $| = 1;
select ($I111III111I1IIII); $I1I1I11IIII1III1; } sub URLEncodeString 
{ my $I11I1II1111IIIII = shift; $I11I1II1111IIIII =~ s/([^a-zA-Z0-9_\-.])/uc sprintf("%%%02x",ord($1))/eg;
return $I11I1II1111IIIII; } sub ExtractSnippetsFromTemplate {
my($I1I1II111I11II1I,@I1I11111111I1I11) = @_; my(@I1I111I111111111);
$I1II1I1I11111II1 = 1; foreach $I1I1II11I11111II (@I1I11111111I1I11)
{ if($I1I1II111I11II1I =~  s/ANACONDASNIP\($I1I1II11I11111II\)(.+)ANACONDAENDSNIP\($I1I1II11I11111II\)//si)
{ push(@I1I111I111111111,$1); } } $I1II1I1I11111II1 = 0; return @I1I111I111111111;
} sub DoLog { open(logfile1,">>$I1I1I11111111III"); $I1I1III1III1IIII = $I1II11I111II1II1; $I1I1III1III1IIII =~ s/^[=\+]+//; while ($I1I1III1III1IIII =~ s/\+/ /) { };
print logfile1 "$I1I1III1III1IIII\n";  close logfile1;  } sub DoSortLog
{ if(!$I1IIII1I1I111II1) { print "Anaconda Error - log viewing not allowed.\n";	exit; }
open(LOGFILE, $I1I1I11111111III); while($I111111111III1I1=<LOGFILE>)
{	 $I11II1II11111II1 .= $I111111111III1I1; } close LOGFILE; @I11II11II1111III = split(/\n/, $I11II1II11111II1);
@I11II1II11111II1 = sort @I11II11II1111III; $I11III1II1II111I=1;
$I11II1II11111II1 = "<TABLE>\n"; foreach $I111III1I11I1II1 (@I11II1II11111II1)
{ if($I11111I111I1IIII eq $I111III1I11I1II1) { $I11III1II1II111I += 1;
} else { $I11II1II11111II1 .= "<TR><TD>$I11III1II1II111I</td><TD>$I11111I111I1IIII</td></tr>\n";
$I11III1II1II111I = 1; $I11111I111I1IIII=$I111III1I11I1II1; }
} $I11II1II11111II1 .= "<TR><TD>$I11III1II1II111I</td><TD>$I11111I111I1IIII</td></tr>\n";
$I11II1II11111II1 .= "</table>\n"; print "$I11II1II11111II1\n";
exit;  } 1;
