Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NNTP problem 1

Status
Not open for further replies.

redgenie

Programmer
Aug 10, 2000
36
GB
I have a script that fetches a list of active articles into an array and it is working fine.

Code:
use Net::NNTP;

my $nntp= Net::NNTP->new($newsServer, Timeout => 60, Debug => 0);
$nntp->group($group);
my $listPointer=$nntp->listgroup();

This code fetches ALOT of articles in many cases and what I want to do is fetch only "recent" articles.

Apparantly this can be done with the "newnews" method, but I cannot get it to return anything!

Code:
use Net::NNTP;

my $nntp= Net::NNTP->new($newsServer, Timeout => 60, Debug => 0);
$nntp->group($group);
my $listPointer=$nntp->newnews($since);

I've tried all kinds of values for $since ranging from 0 to 1 to epoch-10000 and even dates.

Does anyone have any ideas what I could be doing wrong, I can't find any better documentation on the method than this

Thanks in advance :)
 
I spoke too soon, there is another explanation here, that would seem to make sense except it seems to think that "group" should go before the "since". Yet it still doesn't work.


Code:
use Net::NNTP;

my $nntp= Net::NNTP->new($newsServer, Timeout => 60, Debug => 0);
$nntp->group($group);
my $listPointer=$nntp->newnews(time()-86400);

Now surely that should work! All articles in the last day, but it doesn't and there definately are articles!
 
C'mon you guys, someone must know whats wrong :~
 
Would you believe it, this works:

Code:
use Net::NNTP;

my $nntp= Net::NNTP->new($newsServer, Timeout => 60, Debug => 0);
$nntp->group($group);

my $since=time()-86400;
my $listPointer=$nntp->newnews("$since");


If only all the documentation on the net said that!!
 
nice :)

Mike

"Deliver me from the bane of civilised life; teddy bear envy."

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top