Cross Reference: nntp
xref
: /
osnet-11
/
usr
/
src
/
cmd
/
perl
/
5.8.4
/
distrib
/
lib
/
Net
/
demos
/
nntp
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
1
N/A
#!/
usr
/
local
/
bin
/
perl
1
N/A
1
N/A
use
blib
;
1
N/A
use
Getopt
::
Long
;
1
N/A
use
Net
::
NNTP
;
1
N/A
1
N/A
$opt_debug
=
undef
;
1
N/A
1
N/A
GetOptions
(
qw
(
debug
)
)
;
1
N/A
1
N/A
@
groups
= @
ARGV
;
1
N/A
1
N/A
$nntp
=
Net
::
NNTP
->
new
(
'news'
,
Debug
=>
$opt_debug
?
1
:
0
)
;
1
N/A
1
N/A
if
(
$subs
=
$nntp
->
newsgroups
)
1
N/A
{
1
N/A
print
join
(
"\n"
,
(
keys
%
$subs
)
[
0
..
10
])
,
"\n"
;
1
N/A
}
1
N/A
else
1
N/A
{
1
N/A
warn
$nntp
->
message
;
1
N/A
}
1
N/A
1
N/A
foreach
$group
(@
groups
)
1
N/A
{
1
N/A
$new
=
$nntp
->
newnews
(
time
-
3600
,
lc
$group
)
;
1
N/A
1
N/A
if
(
ref
(
$new
)
&&
scalar
(@
$new
)
)
1
N/A
{
1
N/A
print
@{
$news
}[
0
..
3
],
"\n"
1
N/A
if
$news
=
$nntp
->
article
(
$new
->[-
1
])
;
1
N/A
1
N/A
warn
$nntp
->
message
1
N/A
unless
$news
;
1
N/A
}
1
N/A
}
1
N/A
1
N/A
$nntp
->
quit
;
1
N/A
1
N/A