[ Pobierz całość w formacie PDF ]
.####################################################################### NYU Edgar Development Project######################################################################sub match{require 'edgarlib';require 'edgardate';require 'cgi-lib.pl'; #require 'look.pl'; # for binary searchrequire 'ctime.pl'; #&form_init;$Date=&ctime(time); # human-readable date and timefrom the timestamp.$sdate=chop($Date);# Print out a content-type for HTTP/1.0 compatibility#print "Content-type: text/html\n\n";#This line will call method to change current date to Julian numberand#assign it to variable '$julnum'#$julnum = &j_number();# Get the inputread(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});# Split the name-value pairs@pairs = split(/&/, $buffer);# Create associate arrayforeach (@pairs){($key, $value) = split (/=/, $_);$value=&deweb($value);$form{$key} = $value;}# overwrite the selection of form selected by user,# if the user enters a special form not on the picklist.if ($form{'form'} eq ""){ ($userform, @garbage) = split (/\s/, $form{'Form-Pick-List'});}else{ $userform = $form{'form'}; }$userform =~ tr/[a-z]/[A-Z]/; # make sure to convertto uppercase.$date = $form{'date-range'};if($date eq "Now"){$matchdate=&main'jtod($julnum);}elsif($date eq "Last Week"){$matchdate=&main'jtod($julnum-7);}elsif($date eq "Last Two Weeks"){$matchdate=&main'jtod($julnum-15);}elsif($date eq "Last Month"){$matchdate=&main'jtod($julnum-30);}elsif($date eq "Last Three Months"){$matchdate=&main'jtod($julnum-90);}elsif($date eq "Last Six Months"){$matchdate=&main'jtod($julnum-180);}elsif($date eq "Last Nine Months"){$matchdate=&main'jtod($julnum-270);}elsif($date eq "Last Year"){$matchdate=&main'jtod($julnum-360);}else{$matchdate=&main'jtod(2449354);}($nday, $nmon, $nyear)=split(/-/,$matchdate);if($nmon < 10){$nmon=join('','0',$nmon);}if($nday< 10){$nday = join('','0',$nday);}$matchdate=join('',$nyear,$nmon,$nday);$forms="/web/research/master/forms.sorted"; #the edgar master index## field layout: 0 = form 1 =company 2 = CIK 3 = date 4 = path#&main_head(); # output Report Header&field_head(); # output Field Headers forReportprint"<HR>";$hitctr = 0; # hit counter variable$temp="/web/profile/logs/formonly.temp";open(TEMP, ">$temp") || die "Can't open theTEMP FILE";open(COMPANY, $forms) || die "cannot open the INPUT FILE";$logpath = "/web/profile/logs/";$logname = "formonly.log";$logfile = ">>$logpath$logname";open(LOGFILE, $logfile) || die "problem opening Log file";print LOGFILE "$Date | $ENV{REMOTE_HOST} | $ENV{REMOTE_ADDR}|$ENV{HTTP_USER_AGENT} | $userform | $matchdate \n";close LOGFILE || die "problem closing logfile\n";$colon = ":";&look(*COMPANY, $userform,0,0);while (<COMPANY>){last unless /^$userform.*/; #@line = split(/:/);if ((/$form[1]/i || $form[1] eq "ALL")&&($line[3] >= $matchdate)) {$pfx="A HREF=ftp://town.hall.org/";$line[4] =~ tr/ //d; # get rid of the mysterious leading# space in the path.$colen=length($line[1]);$coadj=substr($line[1],1,$colen);$copath="\<".$pfx.$line[4].">".$coadj."</A>";$company = "<A HREF=ftp://town.hall.org/$line[4]>$coadj</A>";@date = split(//,$line[3]);$date = "$date[5]$date[6]-$date[7]$date[8]-$date[1]$date[2]$date[3]$date[4]";$formtype = $line[0];$hitctr++;$form_desc = &form_desc($formtype);print TEMP "$line[3] | $date | $formtype |$form_desc | $copath\n";} # end of IF} # end of WHILEclose(COMPANY) || die "cannot close the INPUT FILE";# this is critical to# reset the line pointer;# else erratic.close(TEMP) || die "Cannot close the TEMP FILE";$sorted = "/web/profile/logs/formonly.sorted";if (-e $sorted){'rm $sorted';}'sort /web/profile/logs/formonly.temp -r -o/web/profile/logs/formonly.sorted';&print_output;print "Your search had <b>$hitctr</b> hit(s).<p>";print "<A HREF=\"http://edgar.stern.nyu.edu/formonly.html\">Next</A> Form search!";&trailer();exit 1;} #end of "eval &match"sub main_head{print "<body>";print "<Title>Edgar Forms Search</Title>";print "<H1>Edgar Forms Search</H1>";print "<p>";print "</body>";} #end of main_head methodsub field_head{$fhdr="<B>FORMS</B>";$chdr="<B>COMPANY NAME</B>";$shdr="<B>FORM DESCRIPTION</B>";$dhdr="<B>DATE FILED</B>";print "<pre>";printf(" %-10s %-10s %-10s %s",$dhdr, $fhdr, $shdr, $chdr);print "</pre>";}sub j_number{local($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)= localtime;$smon=$mon+1;$syear=$year+1900;$timedate=join('-',$mday,$smon,$syear);&main'dtoj($timedate);}sub form_desc{$local=$_[0];$desc=$forms{$local};if ($desc eq ""){ $desc = "Other"; }$desc;}sub print_output{$temps = "/web/profile/logs/formonly.sorted";open(TEMP, $temps) || die "cannot open the sorted temp filefor r-o";while (<TEMP>){@linet = split(/\|/,$_); # split on | character$foobar = $linet[2];print "<pre>";printf("%s %-12s %-21s %s",$linet[1],$linet[2],$linet[3],$linet[4]);print"</pre>"; }close(TEMP) || die "cannot close temp file r-o";}sub trailer{print "<HR>";print "<a href=\"http://edgar.stern.nyu.edu/\">";print "<img src=\"http://edgar.stern.nyu.edu/icons/back
[ Pobierz całość w formacie PDF ]