From 6bf41292c1807437ec7472f7957227f6736109b0 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 8 Jun 2012 14:01:09 -0400 Subject: Why are we still carrying the old perl scripts around? --- perl-v2/pubs-date.cgi | 288 -------------------------------------------------- 1 file changed, 288 deletions(-) delete mode 100644 perl-v2/pubs-date.cgi (limited to 'perl-v2/pubs-date.cgi') diff --git a/perl-v2/pubs-date.cgi b/perl-v2/pubs-date.cgi deleted file mode 100644 index fe37b34..0000000 --- a/perl-v2/pubs-date.cgi +++ /dev/null @@ -1,288 +0,0 @@ -#!/usr/local/bin/perl -wT -# CGI script: PDOS publications by date -# Eddie Kohler, June 10, 1999 - -#use lib '.'; -#use lib '/home/am0/httpd/htdocs/pdosbib'; -#use lib '/u/eddietwo/www/pdos/pdosbib'; -use BibTeX; -use PDOSBib; -use PDOSCGI; - -%date_back = - ('January' => 1, 'February' => 2, - 'March' => 3, 'April' => 4, - 'May' => 5, 'June' => 6, - 'July' => 7, 'August' => 8, - 'September' => 9, 'October' => 10, - 'November' => 11, 'December' => 12); - -sub do_entries () { - my($key, $d, @x, @d, @date, @permute, $x, $y, $i, $ever); - my($current_year) = (gmtime())[5] + 1900; - - foreach $key (@{$e->{'_'}}) { - $d = BibTeX::expand($e, $key); - next if dont_print($d); - $x = $y = htmlize_entry $d; - if (defined $match) { - $y =~ s/&([\w])\w+;/$1/g; - $y =~ s/<.*?>//g; - next if !&matcher($y); - } - push @x, $x; - push @d, $d; - if ($d->{'year'} and $d->{'year'} =~ /to appear/i) { - push @date, 12*$current_year + 12; - $d->{'_show_year'} = $current_year; - } elsif ($d->{'year'}) { - push @date, 12*$d->{'year'} + $date_back{($d->{'month'} or "January")}; - $d->{'_show_year'} = ($d->{'year'} ? $d->{'year'} : 'unknown'); - } else { - push @date, 0; - $d->{'_show_year'} = "(No date)"; - } - push @permute, $#x; - } - - # permute the list, sort by date - @permute = reverse sort { $date[$a] <=> $date[$b] } @permute; - undef $y; - - # print entries - foreach $i (@permute) { - $d = $d[$i]; - if ($d->{'_show_year'} and $d->{'_show_year'} ne $y || !$ever) { - print "\n" if $ever; - $y = $d->{'_show_year'}; - $ever = 1; - print "

$y

\n\n" if $ever; - print "No matches.\n" if !$ever; -} - -##### -# PROCESS_QUERY - -sub process_query ($) { - my($q) = $_[0]; - while ($q =~ /^\&?([^\&]+)(.*)/) { - $_ = url_translate($1); - $q = $2; - if (/^match=(.*)$/) { - $match = $1; - $match =~ s/\///g; - # my name gets mangled a lot... decouto - $match =~ s/decouto/De Couto/i; - } else { - error_exit('Bad Query', <<"EOD;"); -I don't understand part of your query -- specifically, the ``$_'' -part. -EOD; - } - } -} - -## -# INITIALIZATION & READING - -$index_url = "http://$ENV{'SERVER_NAME'}$ENV{'REQUEST_URI'}"; -$index_url =~ s#/[^/]+$#/#; - -&process_query($ENV{'QUERY_STRING'}) if exists $ENV{'QUERY_STRING'}; - -## PRINT DATA - -$| = 1; -print <<"EOD;"; -Content-type: text/html - - - - - - - - -Anonymity Bibliography: Search Results - - - - - - - - - -

Anonymity Bibliography

-
-

By subject | - By date | - Search:  -
-

- - - - - - - - - - - - - - - - -

- -EOD; - -if (defined($match)) { - print "

Publications matching `$match'

\n"; -} else { - print "

Publications by date

\n"; -} - -$| = 0; - -open(BIB, "$pdos_bib_dir/anonbib.bib") - || error_exit("Can't open $pdos_bib_dir/anonbib.bib!"); -$e = BibTeX::parse(*BIB, %initial_strings); -close BIB; - -# make sections -foreach $key (@{$e->{'_'}}) { - next if dont_print($e->{$key}); - $e->{$key}->{'www_section'} = "Miscellaneous" - if (not $e->{$key}->{'www_section'}); -} - -if (defined($match)) { - $sub = 'sub main::matcher ($) { 1'; - if ($match =~ /[\.\^\$\[\](){}*|]/) { - $sub .= " && \$_[0] =~ /$match/oi"; - } elsif ($match eq ':abstract:') { - $sub .= " && \$_[0] =~ /\\(abstract\\b/oi"; - } else { - $_ = $match; - s/\+//; - while ($_ ne '') { - s/^\s+//; - if (/^\"([^\"]+)(.*)/) { - $sub .= " && \$_[0] =~ /$1/oi"; - $_ = $2; - $_ =~ s/^\"//; - } elsif (/^\"\"(.*)/) { - $_ = $2; - } elsif (/^(\S+)(.*)/) { - $sub .= " && \$_[0] =~ /$1/oi"; - $_ = $2; - } - } - } - eval "$sub; }"; -} - -do_entries; - -print <<"EOD;"; -

- - - -EOD; -- cgit v1.2.3-70-g09d2