Thread View: news.software.nntp
7 messages
7 total messages
Started by Mike Mimic
Fri, 18 Apr 2003 00:03
Getting the newest message
Author: Mike Mimic
Date: Fri, 18 Apr 2003 00:03
Date: Fri, 18 Apr 2003 00:03
18 lines
1648 bytes
1648 bytes
Hi! How can I get the newest message in a newsgroup? I am building a simple Perl script which would show me the newest post to the local newsgroup (server runs INN 2). I use Net::NNTP package and I tryed using the return parameter from the group method but it is not true that the bigest message number is also a number of a newest message. Is there any efficient way (despite of loading the whole list of Date lines and than comparing them) for doing this? Mike
Re: Getting the newest message
Author: Bas Ruiter
Date: Fri, 18 Apr 2003 00:51
Date: Fri, 18 Apr 2003 00:51
9 lines
1117 bytes
1117 bytes
read the NNTP RFC. -- Bas Ruiter e-Mail: lordsnow@home.nl www: http://members.home.nl/lordsnow
Re: Getting the newest message
Author: Mike Mimic
Date: Fri, 18 Apr 2003 05:52
Date: Fri, 18 Apr 2003 05:52
28 lines
1932 bytes
1932 bytes
Hi! Bas Ruiter wrote: > read the NNTP RFC. I have read it and I know that for the GROUP command there is written: The successful selection response will return the article numbers of the first and last articles in the group, and an estimate of the number of articles on file in the group. But there are two problems with this: The message with the last number is not really the newest message. I do not know how can that happen but it did. I would like to have the newest message by its Date. I removed the spam message with the "cttlinnd cancel" in one newsgroup and so there is no message with the number which is returned as the last. Should I run "cttlinnd renumber"? The problem is that it has not changed anything. Mike
Re: Getting the newest message
Author: Russ Allbery
Date: Fri, 18 Apr 2003 05:56
Date: Fri, 18 Apr 2003 05:56
27 lines
2066 bytes
2066 bytes
Mike Mimic <ppagee@yahoo.com> writes:
> I have read it and I know that for the GROUP command there is written:
> The successful selection response will return the article numbers of the
> first and last articles in the group, and an estimate of the number of
> articles on file in the group.
> But there are two problems with this:
> The message with the last number is not really the newest message. I do
> not know how can that happen but it did. I would like to have the
> newest message by its Date.
You can't get that without sorting yourself, since the server doesn't sort
messages by date. If you want to do something simple, you're going to
have to settle for arrival time.
If you're willing to settle for arrival time, the command you want is
NEWNEWS.
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Getting the newest message
Author: Curt Welch
Date: Fri, 18 Apr 2003 05:57
Date: Fri, 18 Apr 2003 05:57
27 lines
2460 bytes
2460 bytes
Mike Mimic <ppagee@yahoo.com> wrote: > The message with the last number is not really the newest > message. I do not know how can that happen but it did. > I would like to have the newest message by its Date. You can't have it. The Date: is a value made up when the article is posted and many times, created using the time and time-zone setting from the user's PC. It may or may not have anything to do with the "real" time the article was created or posted depending on how accurate the users PC clock is set. If it's off by 10 years, the Date: header on the article will be off by 10 years (well, most newservers will reject it if it's that much off). The article with the highest article number in the group was the last article to show up at that server. It is the "newest" article for that server. What the Date: header says has nothing to do with when the article happened to show up at the server. This assumes the server is working correctly of course and you don't have something corrupted. If you want to find the article with the most recent Date:, you have to simply get headers for every article in the group and sort them to find the one with the most recent Date:. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Re: Getting the newest message
Author: Mike Mimic
Date: Fri, 18 Apr 2003 06:09
Date: Fri, 18 Apr 2003 06:09
13 lines
1512 bytes
1512 bytes
Hi! > You can't have it. It is true. I understand now. Thanks. :-) What about my second problem with using that number (that I deleted a message)? Mike
Re: Getting the newest message
Author: Curt Welch
Date: Fri, 18 Apr 2003 06:14
Date: Fri, 18 Apr 2003 06:14
28 lines
2303 bytes
2303 bytes
Mike Mimic <ppagee@yahoo.com> wrote: > Hi! > > > You can't have it. > > It is true. I understand now. Thanks. :-) > > What about my second problem with using that number > (that I deleted a message)? I'm not an INN expert anymore so I didn't even try to answer that. But, from what you said, I think there is nothing you need to do. If you cancel an article, the article number should not be re-used. The server should just return an error if you try to fetch an article with that number. The high water mark will not change either. The next article you post to the group (or which shows up for the group), will get the next higher number assigned and it will simply level a gap in the numbers for the article you cancled. This is normal and the way it should work and the way that newsreaders expect it to work. So, even though I don't know what "ctlinnd renumber" does, and I'm not sure what your problem is, I think the answer is no, don't do that. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
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