usr bin perl use CGI must be version or higher use News NNTPClient use

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
=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= @
=33= @
=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= @
=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= @
=55= @
=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= @
=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;