#!/usr/local/bin/perl #-------------------------------------------------------------------------- # This PERL Script is Copyright 2000 # by KitchenMedia - Holden Richards # Unauthorized reuse of this script is # punishable by applicable laws. #-------------------------------------------------------------------------- $querystring = $ENV{'QUERY_STRING'}; print "Content-type: text/html\n\n"; print "\n"; print "\n"; print "\n"; print "The Top Ten\: Writers Pick Their Favorite Books\n"; print " \n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
\n"; print "
\n"; print "
\n"; print "\n"; print "
\n"; print "
\n"; print "\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "\n"; print "
\n"; print "
\n"; print "\n"; print "
\n"; print "\n"; print "
\n"; print "
\n"; $datafile = "database/blogging.data"; $count =0; open(z,"<$datafile") || die "Can't open $_ "; while (!eof(z)) { $line = ; # # Read Query Match # if ($count <1) { $count = 1; my @test=split(/\|/,$line); $key=@test[0]; $blog_title = @test[1]; $blog_date = @test[2]; $blog_text = @test[3]; $blog_image = @test[4]; } } close(z); # Blog breakdown blogentry my @test99=split(/\. /,$blog_text); $sentence1=@test99[0]; $sentence2=@test99[1]; $sentence3=@test99[2]; $sentence4=@test99[4]; if ($sentence1 =~ m@([0-9a-zA-Z])@g) { $tentry = $sentence1.". ";} if ($sentence2 =~ m@([0-9a-zA-Z])@g) { $tentry = $tentry.$sentence2.". ";} if ($sentence3 =~ m@([0-9a-zA-Z])@g) { $tentry = $tentry.$sentence3.". ";} # if ($sentence4 =~ m@([0-9a-zA-Z])@g) { $tentry = $tentry.$sentence4.". ";} $blogentry = $tentry; # Blog breakdown blogentry my @test99=split(/\. /,$blogentry); $sentence1=@test99[0]; $sentence2=@test99[1]; $sentence3=@test99[2]; $sentence4=@test99[4]; if ($sentence1 =~ m@([0-9a-zA-Z])@g) { $tentry = $sentence1.". ";} if ($sentence2 =~ m@([0-9a-zA-Z])@g) { $tentry = $tentry.$sentence2.". ";} if ($sentence3 =~ m@([0-9a-zA-Z])@g) { $tentry = $tentry.$sentence3.". ";} # if ($sentence4 =~ m@([0-9a-zA-Z])@g) { $tentry = $tentry.$sentence4.". ";} $blogentry = $tentry; $blogentry =~ s/\

\n"; } elsif (($blogentry =~ /\

\n"; } else { $blogentry = $blogentry." . .\n"; } $blogentry =~ s/Â/\ /ig; $blogentry =~ s/\//ig; $blogentry =~ s/
//ig; $blogentry =~ s/
//ig; $blogentry =~ s/\<\/div\>//ig; $blogentry =~ s/\.\./\./ig; $blogentry =~ s/\//gs; # Remove XML $blogentry=~s///gs; # Remove Meta elements $blogentry=~s///gsi; # Remove visual formatting $blogentry=~s///gsi; $blogentry=~s/<\/span>//gsi; # Remove some unknown stuff $blogentry=~s///gsi; $blogentry=~s/<\/o:p>//gsi; # Remove stylesheet stuff $blogentry=~s//

/gsi; $blogentry=~s///gsi; $blogentry=~s///gsi; # Remove style attributes $blogentry=~s/\sstyle\=\'[^']*?mso-.*?\'//gsi; # Remove some more garbage $blogentry=~s///gsi; $blogentry=~s///gsi; $blogentry=~s///gsi; # Remove visual formatting $blogentry=~s///gsi; $blogentry=~s/<\/div>//gsi; # Convert ASCII value non-breaking spaces to blogentry ones $blogentry=~s/\&\#160\;/\ \;/gsi; # Remove duplicate spaces $blogentry=~s/ +/ /gsi; $blogentry=~s/(\ \;){2,}/\ \;/gsi; $blogentry=~s/ \/\/gsi; $blogentry=~s/\n{2,}/\n/gsi; # Remove extra spaces after heading numbers $blogentry=~s/(\S*?)\ \;/$1/gsi; # Remove shape info from image tags $blogentry=~s/\sv\:shapes\=\".*?\"\>/\>/gsi; # Remove unused link targets (only footnote ones are linked to!) $blogentry=~s/()\s*?\(.*?)\<\/a\>/$1$2/gsi; $blogentry=~s/Figure\s\<\/a\>/Figure /gsi; $blogentry=~s/Table\s\<\/a\>/Table /gsi; $blogentry=~s/\s?\<\/a\>//gsi; # Remove table cell formatting $blogentry=~s/(]*?)\swidth\=\d+/$1/gsi; $blogentry=~s/(]*?)\svalign\=\w*/$1/gsi; $blogentry=~s/(]*?)\sstyle\=\'.*?\'/$1/gsi; $blogentry=~s/(]*?)\sclass\=\w*/$1/gsi; $blogentry=~s/(]*?)\sx\:num\=\".*?\"/$1/gsi; $blogentry=~s/(]*?)\sx\:str\=\".*?\"/$1/gsi; # Remove unnecessary paragraph marks from table cells $blogentry=~s/()\s*

(.*?)<\/p>\s*(<\/td>)/$1$2$3/gsi; $blogentry =~ s/\ \-\-/\&mdash\;/ig; $blogentry =~ s/’/\'/ig; $blogentry =~ s/“/\"/ig; $blogentry =~ s/”/\"/ig; $blogentry =~ s/…/\.\.\./ig; $blogentry =~ s/`/\'/ig; $blogentry =~ s/Ę/\ /ig; $blogentry =~ s/‘/\'/ig; $blogentry =~ s/\&\#8217\;/\'/ig; $blogentry =~ s/\&\#8216\;/\'/ig; $blogentry =~ s/\&\#8209\;/\-/ig; $blogentry =~ s/\&\#8220\;/\"/ig; $blogentry =~ s/\&\#8221\;/\"/ig; # unicode to utf $blogentry =~ s/\\u([[:xdigit:]]{1,4})/chr(eval("0x$1"))/egis; $blogentry =~ s/qq/\/ig; # for digg link my @test99=split(/\,/,$blog_date); $tblog_wday = @test99[0]; $tblog_mon = @test99[1]; $tblog_year = @test99[2]; my @test00=split(/\ /,$tblog_mon); $tblog_mon = @test00[1]; $tblog_date = @test00[2]; if ($tblog_mon =~ /Jan/) {$tblog_mon = "01";} if ($tblog_mon =~ /Feb/) {$tblog_mon = "02";} if ($tblog_mon =~ /Mar/) {$tblog_mon = "03";} if ($tblog_mon =~ /Apr/) {$tblog_mon = "04";} if ($tblog_mon =~ /May/) {$tblog_mon = "05";} if ($tblog_mon =~ /Jun/) {$tblog_mon = "06";} if ($tblog_mon =~ /Jul/) {$tblog_mon = "07";} if ($tblog_mon =~ /Aug/) {$tblog_mon = "08";} if ($tblog_mon =~ /Sep/) {$tblog_mon = "09";} if ($tblog_mon =~ /Oct/) {$tblog_mon = "10"} if ($tblog_mon =~ /Nov/) {$tblog_mon = "11";} if ($tblog_mon =~ /Dec/) {$tblog_mon = "12"} $sdate= $tblog_year.$tblog_mon.$tblog_date; $sdate=~ s/\ //ig; $doctitle= $blog_title; $doctitle =~ s/\ /\_/ig; $datafile = $sdate."_".$doctitle.".html"; $prefix = "http://www.toptenbooks.net/blog/"; $outfile = $prefix.$datafile; $outfile =~ s/\ //ig; $outfile =~ s/\n//ig; print "\n"; print "
\n"; # open blog table print "Latest Blog Entry:\n"; print "
\n"; print "\n"; print "
\n"; print "



\n"; print "
\n"; print "
\n"; print "

$blog_title

$blog_date\n\n"; print "

$blogentry Read More>\n"; print "
\n"; # close blog table print "

\n"; print "

\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "

New Author List

\n"; print "

New exclusive lists created by authors for the TopTenBooks.net website.\n"; print "
\n"; $file = "admin/current.data"; open FILE, "<$file" or die "Could not open $file: $!\n"; @array=; close FILE; $currentline=@array[-1]; my @test=split(/\|/,$currentline); $key=@test[0]; $username=@test[1]; $number_one=@test[2]; $number_two=@test[3]; $number_three=@test[4]; $number_four=@test[5]; $number_five=@test[6]; $number_six=@test[7]; $number_seven=@test[8]; $number_eight=@test[9]; $number_nine=@test[10]; $number_ten=@test[11]; $author_one=@test[12]; $author_two=@test[13]; $author_three=@test[14]; $author_four=@test[15]; $author_five=@test[16]; $author_six=@test[17]; $author_seven=@test[18]; $author_eight=@test[19]; $author_nine=@test[20]; $author_ten=@test[21]; $date=@test[22]; print "

\n"; print "The Top Ten List of \$username\<\/b\>\n"; print "

    \n"; print "
  1. $number_one by $author_one\n"; print "
  2. $number_two by $author_two\n"; print "
  3. $number_three by $author_three\n"; print "
  4. $number_four by $author_four\n"; print "
  5. $number_five by $author_five\n"; print "
  6. $number_six by $author_six\n"; print "
  7. $number_seven by $author_seven\n"; print "
  8. $number_eight by $author_eight\n"; print "
  9. $number_nine by $author_nine\n"; print "
  10. $number_ten by $author_ten\n"; print "
\n"; print "
\n"; print "
\n"; print "

Classic List

\n"; print "

From exclusive lists published in the book \"The Top Ten\".\n"; print "
\n"; $file = "admin/classic.data"; open FILE, "<$file" or die "Could not open $file: $!\n"; @array=; close FILE; $randomline=$array[rand @array]; my @test=split(/\|/,$randomline); $key=@test[0]; $username=@test[1]; $number_one=@test[2]; $number_two=@test[3]; $number_three=@test[4]; $number_four=@test[5]; $number_five=@test[6]; $number_six=@test[7]; $number_seven=@test[8]; $number_eight=@test[9]; $number_nine=@test[10]; $number_ten=@test[11]; $author_one=@test[12]; $author_two=@test[13]; $author_three=@test[14]; $author_four=@test[15]; $author_five=@test[16]; $author_six=@test[17]; $author_seven=@test[18]; $author_eight=@test[19]; $author_nine=@test[20]; $author_ten=@test[21]; $date=@test[22]; print "

\n"; print "The Top Ten List of \$username\<\/b\>\n"; print "

    \n"; print "
  1. $number_one by $author_one\n"; print "
  2. $number_two by $author_two\n"; print "
  3. $number_three by $author_three\n"; print "
  4. $number_four by $author_four\n"; print "
  5. $number_five by $author_five\n"; print "
  6. $number_six by $author_six\n"; print "
  7. $number_seven by $author_seven\n"; print "
  8. $number_eight by $author_eight\n"; print "
  9. $number_nine by $author_nine\n"; print "
  10. $number_ten by $author_ten\n"; print "
\n"; print "
\n"; print "
\n"; print "

Reader Submitted List

\n"; print "

Lists submitted to the TopTenBooks.net website.\n"; print "
\n"; $file = "topten.data"; open FILE, "<$file" or die "Could not open $file: $!\n"; @array=; close FILE; $randomline=$array[rand @array]; my @test=split(/\|/,$randomline); $key=@test[0]; $username=@test[1]; $number_one=@test[2]; $number_two=@test[3]; $number_three=@test[4]; $number_four=@test[5]; $number_five=@test[6]; $number_six=@test[7]; $number_seven=@test[8]; $number_eight=@test[9]; $number_nine=@test[10]; $number_ten=@test[11]; $author_one=@test[12]; $author_two=@test[13]; $author_three=@test[14]; $author_four=@test[15]; $author_five=@test[16]; $author_six=@test[17]; $author_seven=@test[18]; $author_eight=@test[19]; $author_nine=@test[20]; $author_ten=@test[21]; $date=@test[22]; print "

\n"; print "From $username submitted $date\n"; print "

    \n"; print "
  1. $number_one by $author_one\n"; print "
  2. $number_two by $author_two\n"; print "
  3. $number_three by $author_three\n"; print "
  4. $number_four by $author_four\n"; print "
  5. $number_five by $author_five\n"; print "
  6. $number_six by $author_six\n"; print "
  7. $number_seven by $author_seven\n"; print "
  8. $number_eight by $author_eight\n"; print "
  9. $number_nine by $author_nine\n"; print "
  10. $number_ten by $author_ten\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "

\n"; print "his is the best of times and the worst of times for passionate readers. On the one hand, we are living in a Golden Age as online retailers make millions of books just a click away. Never before have so many works been within such easy reach. But when anything is possible, choice becomes torture. What to pick? Where to start? This one? That one? How about this\&mdash\;and that? What will I like? What\'s worth my time?\n"; print "

To help answer these questions, we turned to the experts, asking 125 top American and British authors to list their 10 favorite works of fiction of all time. The results were published in \"The Top Ten\: Writers Pick Their Favorite Books.\" Edited by J. Peder Zane and published by W.W. Norton, \"The Top Ten\" is the ultimate guide to the world\'s greatest books. As Norman Mailer, Annie Proulx, Stephen King, Joyce Carol Oates, Jonathan Franzen, Claire Messud, Margaret Drabble, Michael Chabon, Peter Carey and others name the 10 books that have meant the most to them, you\'ll be reminded of books you have always loved and introduced to works awaiting your discovery.\n"; print "

\"The Top Ten\" includes summaries of every book mentioned on those lists \&mdash\; 544 titles in all, each of which is considered to be among the 10 greatest books ever written by at least one leading writer. It also offers Top Ten Lists tabulated from their picks, including\: \n"; print "

The Top Ten Books of All Time \n"; print "
The Top Ten Books by Living Writers \n"; print "
The Top Ten Books of the 20th Century \n"; print "
The Top Ten Mysteries\n"; print "
The Top Ten Comedies \n"; print "
Click here to see all the author lists.\n"; print "

Now this Website is expanding on the book. In addition to posting all 125 lists from \"The Top Ten,\" we will feature a new list each week from a prominent author. We will also highlight a list submitted by one of our readers \&mdash\; maybe even you! And our blog will include updates on the world of classic books, as well as your comments. Through it all we will help you answer that most pressing literary question\: What should I read next? \n"; print "

\n"; print "Free and Easy Way to Support this Site\n"; print "

\n"; print "Use the Top Ten as your gateway to Amazon and we'll receive a small commission on everything your purchase. Just Click here. THANKS !\n"; print "

\n"; print "Get a FREE Top Ten Screen Saver here.\n"; print "

\n"; print "Need editing help? Click here.\n"; print "

\n"; print "Short on time? Check out a book summary.\n"; print "

Follow The Top Ten on:

\n"; print "

\n"; print "

\n"; print "


\n"; print "

\n"; print "

\n"; print "\n"; print "


\n"; print "

\n"; print "


\n"; print "\n"; print "
\n"; print "\n"; print "\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "\n"; print "\n"; print "

\n"; print "
\n"; print "
\n"; print "
\n"; print "\n"; print "
\n"; print "
\n"; print "
\n"; print "All Material Copyright ©\; 2010 Not for use without permission \n"; print "
\n"; print "

\n"; print "
\n"; print "\n"; print "\"buy\n"; print "\"about\n"; print "\"your\n"; print "\"about\n"; print "\"the\n"; print "\"for\n"; print "\n"; print "\n"; print "\n"; print "\n";