#!/usr/bin/perl use CGI; # must be version 2 or higher use News::NNTPClient; use MIME::Base64; $nntpserver = "news.teleport.com"; # location of news server ## because of the copyright nature of this material, you should ## put this script in a directory that has an appropriate htaccess file. @groups = ( ["clari.living.comics.bizarro", "Bizarro"], ["clari.living.comics.cafe_angst","Cafe Angst"], ["clari.living.comics.doonesbury","Doonesbury"], ["clari.living.comics.forbetter","For Better or For Worse"], ["clari.living.comics.foxtrot","Foxtrot"], ["clari.living.comics.ozone_patrol","Ozone Patrol"], ["clari.editorial.cartoons.toles","Toles"], ["clari.editorial.cartoons.worldviews","Worldviews"], ["clari.news.photos","News photos (not a comic, but handy)"], ); $Q = new CGI; $Qself = $Q->self_url; unless ($group = $Q->param('group')) { # nothing at all, give index $links = join "\n", map { "

[0]\">$_->[1]" } @groups; print <<"GROK"; q/"/; @{[$Q->header]} @{[$Q->start_html('Comics','merlyn@stonehenge.com')]}

Read the Comics

Select the group you want to read:


$links

Please respect the copyrights and license agreements of this service. @{[$Q->end_html]} GROK q/"/; exit 0; } unless ($article = $Q->param('article')) { # group but no art, give group $N = new News::NNTPClient($nntpserver,119,0); for ($N->xover($N->group($group))) { ($numb,$subj) = split /\t/; $links .= "

$subj\n"; } print <<"GROK"; q/"/; @{[$Q->header]} @{[$Q->start_html('Comics','merlyn@stonehenge.com')]}

Read the Comics

Select the article you wish to view:


$links

Please respect the copyrights and license agreements of this service. @{[$Q->end_html]} GROK q/"/; exit 0; } ## $group and $article both valid: $N = new News::NNTPClient($nntpserver,119,0); $N->group($group); @art = $N->article($article); shift @art while @art and $art[0] !~ /^Content-Type: (image\/[-a-z]+)/; $type = $1; shift @art while @art and $art[0] !~ /^\s*$/; pop @art; # heh $gif = decode_base64(join "", @art); print "Content-type: $type\n\n"; print $gif; exit 0;