From 1d07a97300d48872726edd989f53bf489dc00a41 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sat, 17 May 2003 06:10:20 +0000 Subject: Initial revision svn:r2 --- perl/mkpdospubs.pl | 235 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100644 perl/mkpdospubs.pl (limited to 'perl/mkpdospubs.pl') diff --git a/perl/mkpdospubs.pl b/perl/mkpdospubs.pl new file mode 100644 index 0000000..c500b42 --- /dev/null +++ b/perl/mkpdospubs.pl @@ -0,0 +1,235 @@ +v#!/usr/local/bin/perl +# *** +# *** CGI script: static PDOS publication list +# *** Eddie Kohler, June 10, 1999 +# *** +# *** Take a look at PDOSBib.pm +# *** to change things like people's URLs +# *** and how different bibliography entries are generated +# *** +# *** Take a look at PDOSCGI.pm +# *** to change where files are located +# *** + +use lib '/home/am0/httpd/htdocs/pdosbib'; +use BibTeX; +use PDOSBib; +use PDOSCGI; + +sub do_entries () { + my($section, $key, $d); + foreach $section (@sections) { + # print section header + print '

'; + print $section, "

\n"; + print "\n"; + } +} + + +sub do_sections () { + foreach $section (@sections) { + print '

', $section, "

\n"; + } +} + + +# main program +if (@ARGV > 0) { + open(BIB, $ARGV[0]) || die "can't open $ARGV[0]"; +} else { + open(BIB, "<&STDIN"); +} +$e = BibTeX::parse(*BIB, %initial_strings); +close BIB; + +if (@ARGV > 1) { + open(STDOUT, ">$ARGV[1]") || die "can't open $ARGV[1]"; +} + +# make sections +@sections = (); +foreach $key (@{$e->{'_'}}) { + next if dont_print($e->{$key}); + $section = $e->{$key}->{'www_section'}; + $e->{$key}->{'www_section'} = $section = "Miscellaneous" if $section eq ''; + if (!exists $sections{$section}) { + push @sections, $section if $section ne ''; + $sections{$section} = 1; + } +} +push @sections, 'Miscellaneous' + if $sections{''} && !$sections{'Miscellaneous'}; + +## PRINT STUFF! +$argv_string = join(' ', 'mkpdospubs.pl', @ARGV); +print <<"EOD;"; + + + + + + + +PDOS Publications + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +




  MIT > LCS > PDOS Home > 

Publications > 

By subject


+Projects
+People
+Software

+By date

+ + + + + + + + + + + + + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +


Publication search:
+


Subjects:
+EOD; + +## PRINT SECTIONS +do_sections; + +print <<"EOD;"; +

+
+ +

Publications by subject

+ +EOD; + +## PRINT ENTRIES +do_entries; + +print <<"EOD;"; +

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