=1= #!/usr/bin/perl =2= =3= use CGI; # must be version 2 or higher =4= use News::NNTPClient; =5= use MIME::Base64; =6= =7= $nntpserver = "news.teleport.com"; # location of news server =8= =9= ## because of the copyright nature of this material, you should =10= ## put this script in a directory that has an appropriate htaccess file. =11= =12= @groups = ( =13= ["clari.living.comics.bizarro", "Bizarro"], =14= ["clari.living.comics.cafe_angst","Cafe Angst"], =15= ["clari.living.comics.doonesbury","Doonesbury"], =16= ["clari.living.comics.forbetter","For Better or For Worse"], =17= ["clari.living.comics.foxtrot","Foxtrot"], =18= ["clari.living.comics.ozone_patrol","Ozone Patrol"], =19= ["clari.editorial.cartoons.toles","Toles"], =20= ["clari.editorial.cartoons.worldviews","Worldviews"], =21= ["clari.news.photos","News photos (not a comic, but handy)"], =22= ); =23= =24= $Q = new CGI; =25= $Qself = $Q->self_url; =26= =27= unless ($group = $Q->param('group')) { # nothing at all, give index =28= $links = join "\n", =29= map { "

[0]\">$_->[1]" } @groups; =30= =31= print <<"GROK"; q/"/; =32= @ =33= @ =34=

Read the Comics

=35=

Select the group you want to read: =36=


=37= $links =38=
=39=

Please respect the copyrights and license agreements of this service. =40= @ =41= GROK =42= q/"/; =43= exit 0; =44= } =45= =46= unless ($article = $Q->param('article')) { # group but no art, give group =47= $N = new News::NNTPClient($nntpserver,119,0); =48= for ($N->xover($N->group($group))) { =49= ($numb,$subj) = split /\t/; =50= $links .= "

$subj\n"; =51= } =52= =53= print <<"GROK"; q/"/; =54= @ =55= @ =56=

Read the Comics

=57=

Select the article you wish to view: =58=


=59= $links =60=
=61=

Please respect the copyrights and license agreements of this service. =62= @ =63= GROK =64= q/"/; =65= exit 0; =66= } =67= =68= ## $group and $article both valid: =69= $N = new News::NNTPClient($nntpserver,119,0); =70= $N->group($group); =71= @art = $N->article($article); =72= shift @art while @art and $art[0] !~ /^Content-Type: (image\/[-a-z]+)/; =73= $type = $1; =74= shift @art while @art and $art[0] !~ /^\s*$/; =75= pop @art; # heh =76= $gif = decode_base64(join "", @art); =77= print "Content-type: $type\n\n"; =78= print $gif; =79= exit 0;