Веб Дизайн - статьи

       

because of the copyright nature


=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 { "<p><a href=\"$Qself?group=$_->[0]\">$_->[1]</a>" } @groups; =30= =31= print <<"GROK"; q/"/; =32= @{[$Q->header]} =33= @{[$Q->start_html('Comics','merlyn@stonehenge.com')]} =34= <h1>Read the Comics</h1> =35= <p>Select the group you want to read: =36= <HR> =37= $links =38= <HR> =39= <p>Please respect the copyrights and license agreements of this service. =40= @{[$Q->end_html]} =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 .= "<p><a href=\"$Qself&article=$numb\">$subj</a>\n"; =51= } =52= =53= print <<"GROK"; q/"/; =54= @{[$Q->header]} =55= @{[$Q->start_html('Comics','merlyn@stonehenge.com')]} =56= <h1>Read the Comics</h1> =57= <p>Select the article you wish to view: =58= <HR> =59= $links =60= <HR> =61= <p>Please respect the copyrights and license agreements of this service. =62= @{[$Q->end_html]} =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;

Содержание раздела