๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #71681

Re: simple Perl script needed

#71681
From: Blinky the Shark
Date: Tue, 24 May 2005 08:01
41 lines
2747 bytes
Szymon Sokรณยณ wrote:
> In news.software.nntp sebhoff2002@yahoo.com wrote:
>> Yes - I had already tried this. But it's very slow to retrieve
>> everything - because of the news server... What I need now is something
>> that just gets the headers - quick. ;-) Will look into it and see how I
>> can change the script.
> Well, if you need something simple, short and fast (but not tested very
> thoroughly and without any error handling...):

> #!/usr/bin/perl -w
> use Net::NNTP; 
> # customize these 3 lines according to your needs
> my $output = "/directory/where/output/goes/";
> my $nntpserver = "news.somedomain.com";
> my @groups = ("news.software.nntp", "news.software.readers");

> my $nntp = Net::NNTP->new($nntpserver);
> $| = 1;
> for my $group (@groups) {
>   my $file;
>   open $file, ">${output}/$group";
>   my $all = $nntp->listgroup($group);
>   my $total = scalar @$all;
>   printf "Group $group, total of %d messages\n", $total;
>   my $j = 1;
>   for my $msg (@$all) {
>     printf "Getting #%d of %d message headers\r", $j++, $total;
>     $nntp->head($msg,$file);
>     print $file "\n"; # an empty line separates headers
>   }
>   close $file;
>   print "\n";
> }
> $nntp->quit;

Where does the authentication take place?

-- 
Blinky         Linux Registered User 297263
Killing all Usenet posts from Google Groups
Info:   http://blinkynet.net/comp/uip5.html
Technical Details
Message-ID: <slrnd95nqo.1sb.no.spam@thurston.blinkynet.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!number1.nntp.ams.giganews.com!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <1116840238.189967.41700@o13g2000cwo.googlegroups.com> <tskirvin.20050523173603$2bdd@cairo.ks.uiuc.edu> <1116917630.486426.100140@z14g2000cwz.googlegroups.com> <d6umac$o5g$1@galaxy.uci.agh.edu.pl>

Show Full Headers
Complete Article Headers
Message-ID: <slrnd95nqo.1sb.no.spam@thurston.blinkynet.net>
Subject: Re: simple Perl script needed
Date: Tue, 24 May 2005 08:01:29 +0000
From: Blinky the Shark <no.spam@box.invalid>
References: <1116840238.189967.41700@o13g2000cwo.googlegroups.com> <tskirvin.20050523173603$2bdd@cairo.ks.uiuc.edu> <1116917630.486426.100140@z14g2000cwz.googlegroups.com> <d6umac$o5g$1@galaxy.uci.agh.edu.pl>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!number1.nntp.ams.giganews.com!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
Newsgroups: news.software.nntp
Followup-To: news.software.readers
Organization: http://blinkynet.net
Lines: 41
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: individual.net SAXarGv5JdWGDAkFX63iDwaDI7Cp6lsi8aWw7e7cK7F+TqEBp7
X-Face: Jb-wQ7r&vrN}~8MC5B09S4&.ieh!Q:Di/XN.xrd#CU%;
 )bPa`Hm^(,3o$n(s75[P+$F+Q^4~Owj`WzkBtZU/#gL2BvEBm/e=/1,R0}d@q@)E
User-Agent: slrn/0.9.8.1 (Linux)