🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
8 messages
8 total messages Started by sebhoff2002 Mon, 23 May 2005 09:23
simple Perl script needed
#167015
Author: sebhoff2002
Date: Mon, 23 May 2005 09:23
25 lines
2258 bytes
Hi,
I've been browsing CPAN and other sources for something which I expect
to be pretty simple/standard - but I have been a bit overwhelmed by
what's available and since I'm not a (real) programmer, I'm also a bit
lost as to how to implement a solution. I found lots of modules and I'm
sure they can do what I want to do - but what I would really need is a
sample script that uses the "best" method. Once I have this, I can
learn and extend the functionality according to my needs. ;-)

I'm looking for a simple Perl script that connects to a NNTP-server
(with authentication) and downloads all xover headers of a list of
newsgroups to a local disk. Ideally, this would be fast (probably
depends on the server software...) and the output should be in a format
that can be easily post-processed (but the format is not a major
concern).

Secondly, does anybody know of any software/Perl-script that
consistently tracks which elements of postings are quoted from previous
ones? I'm a linguist and for my research, I need to be able to
determine exactly which elements of a previous message are referred
to....

Thanks for any kind of input!
Sebastian
Re: simple Perl script needed
#167014
Author: Ted S.
Date: Mon, 23 May 2005 13:59
19 lines
1756 bytes
Somebody claiming to be sebhoff2002@yahoo.com wrote in 
news:1116840238.189967.41700@o13g2000cwo.googlegroups.com:

> I'm looking for a simple Perl script that connects to a NNTP-server
> (with authentication) and downloads all xover headers of a list of
> newsgroups to a local disk. Ideally, this would be fast (probably
> depends on the server software...) and the output should be in a format
> that can be easily post-processed (but the format is not a major
> concern).

You may wish to try asking on a Perl group , or a mailing list like the 
ones at Active State. <http://listserv.ActiveState.com/mailman/mysubs> is 
the URL for managing subscriptions, but you may have to register first.

-- 
Ted <fedya at bestweb dot net>
TV Announcer: It's 11:00.  Do you know where your children are?
Homer: I told you last night, *no*!
<http://www.snpp.com/episodes/4F06.html>
Re: simple Perl script needed
#167013
Author: SINNER
Date: Mon, 23 May 2005 15:46
12 lines
1531 bytes
*  Wrote in news.software.readers:

> I'm looking for a simple Perl script that connects to a NNTP-server
> (with authentication) and downloads all xover headers of a list of
> newsgroups to a local disk.

Leafnode, while not a perl script can accomplish this piece of what you 
need. You are posting from Google and dont mention an OS, Leafnode runs 
on *nix.

-- 
David
Re: simple Perl script needed
#167017
Author: Tim Skirvin
Date: Mon, 23 May 2005 17:36
19 lines
2002 bytes
sebhoff2002@yahoo.com writes:

>I'm looking for a simple Perl script that connects to a NNTP-server
>(with authentication) and downloads all xover headers of a list of
>newsgroups to a local disk. Ideally, this would be fast (probably
>depends on the server software...) and the output should be in a format
>that can be easily post-processed (but the format is not a major
>concern).

        http://www.killfile.org/~tskirvin/software/news/kiboze/

        That actually gets all of the articles, period, but it could be
modified pretty easily and cleanly.


			   - Tim Skirvin (tskirvin@killfile.org)
-- 
http://www.killfile.org/~tskirvin/  Skirv's Homepage <FISH>< <*>
http://www.killfile.org/~tskirvin/posts.html	   Skirv's Posts
Re: simple Perl script needed
#167016
Author: sebhoff2002
Date: Tue, 24 May 2005 06:53
7 lines
1499 bytes
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.
Thanks for your reply!
Sebastian
Re: simple Perl script needed
#167018
Author: Szymon Sokół
Date: Tue, 24 May 2005 07:49
39 lines
2901 bytes
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;

-- 
Szymon Sokół (SS316-RIPE) -- Network Manager                                B
Computer Center, AGH - University of Science and Technology, Cracow, Poland O
http://home.agh.edu.pl/szymon/ PGP key id: RSA: 0x2ABE016B, DSS: 0xF9289982 F 
Free speech includes the right not to listen, if not interested -- Heinlein H
Re: simple Perl script needed
#167144
Author: Szymon Sokół
Date: Tue, 24 May 2005 09:09
14 lines
2159 bytes
Blinky the Shark <no.spam@box.invalid> wrote:
> Szymon Sokó? wrote:

> > my $nntp = Net::NNTP->new($nntpserver);

> Where does the authentication take place?
Uh, add after the line above:
$nntp->authinfo("yourusername", "yourpassword");

-- 
Szymon Sokół (SS316-RIPE) -- Network Manager                                B
Computer Center, AGH - University of Science and Technology, Cracow, Poland O
http://home.agh.edu.pl/szymon/ PGP key id: RSA: 0x2ABE016B, DSS: 0xF9289982 F 
Free speech includes the right not to listen, if not interested -- Heinlein H
Re: simple Perl script needed
#167145
Author: sebhoff2002
Date: Tue, 24 May 2005 09:27
11 lines
1821 bytes
That's no problem - just use Net::NNTP::Auth and add the following
after you connect to the server:

my ($nntpuser, $nntppass) = Net::NNTP::Auth->nntpauth($server);
$NNTP->authinfo($nntpuser, $nntppass) if defined($nntppass);

You'll need to have a file called .nntpauth in your home directory for
this to work properly...

Sebastian
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads