🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
4 messages
4 total messages Started by Tom Sun, 16 Feb 2003 17:17
Suggestings for NNTP command with attachment app
#64055
Author: Tom
Date: Sun, 16 Feb 2003 17:17
43 lines
2779 bytes
I am looking for suggestions on the best way to implement a binary news
grabber (and Usenet reader).  I read through RFC 977 which gave me a lot of
questions as how to best implement my commands.

The idea is I need to read all the articles (at least the headers) of a
group to determine if there is a binary file attached.  I understand how to
do that, but I am looking for the most efficient way (so the server isn't
bogged down).

From reading RFC 977, here is what I have come up with:

To read a messsage:
------------------
GROUP <groupname>
ARTICLE <articleid>

To locate all the posts with binary attachments:
------------------------------------------------
GROUP <groupname>
STAT <articleid>
HEAD

I would then process the results of the HEAD command looking for mime types,
etc.

Would I just do this in some big loop?  It seems rather inefficient. I know
NNTP is old, so that might just be the way things are done, I just wanted to
see what others are doing first.

Also, on some binary "grabbers", there are options like "read nn number of
lines to determine if post is binary", where nn is a number that can be
entered (usually defaulting to 50).

 I am assuming that this is the first nn lines of the body.  Would that mean
the grabber is getting the entire post in a group (unless there is a way to
get the first nn lines of an article)?  Getting every post would effectively
mean it is downloading all the binaries in the group, which is not the case.

Thanks,



Re: Suggestings for NNTP command with attachment app
#64062
Author: Jeremy
Date: Mon, 17 Feb 2003 06:20
56 lines
3006 bytes
Tom <webview@rcn.com> wrote:

> I am looking for suggestions on the best way to implement a binary news
> grabber (and Usenet reader).  I read through RFC 977 which gave me a lot of
> questions as how to best implement my commands.

That's not surprising; 977 is very old, and doesn't include all of what we
currently know as "NNTP".

> To read a messsage:
> ------------------
> GROUP <groupname>
> ARTICLE <articleid>

You don't have to do GROUP for every article.  You proably know that, but
I just wanted to make sure.

> To locate all the posts with binary attachments:
> ------------------------------------------------
> GROUP <groupname>
> STAT <articleid>
> HEAD
> 
> I would then process the results of the HEAD command looking for mime types,
> etc.

No.  One of the things that's not in 977 is XOVER, which is what you want.
You do one command and get back a list of a range of articles and the content
of certain headers in them.

Have a look at RFC 2980.

However, you can't look for MIME types; almost no one posts binaries with
MIME.  Unfortunately, the way they are posted, you really have to use a lot
of guesswork based on experience, especially when you're looking for
multipart binaries.

> Also, on some binary "grabbers", there are options like "read nn number of
> lines to determine if post is binary", where nn is a number that can be
> entered (usually defaulting to 50).
> 
>  I am assuming that this is the first nn lines of the body.  Would that mean
> the grabber is getting the entire post in a group (unless there is a way to
> get the first nn lines of an article)?  Getting every post would effectively
> mean it is downloading all the binaries in the group, which is not the case.

The only way to do that would be to tear down the connection after reading
the desired number of lines, and then re-open a new connection.  There is no
way to abort a transfer in progress.

Dropping connections a lot is a bad idea, because the server may not keep up
and you may hit a connection limit on the server side.

-- 
Jeremy  |  jeremy@exit109.com
Re: Suggestings for NNTP command with attachment app
#64064
Author: Juergen Helbing
Date: Mon, 17 Feb 2003 07:40
59 lines
3061 bytes
"Tom" <webview@rcn.com> wrote:

>The idea is I need to read all the articles (at least the headers) of a
>group to determine if there is a binary file attached.  I understand how to
>do that, but I am looking for the most efficient way (so the server isn't
>bogged down).

The best way is actually to use the XHDR command with 
"Subject"  as parameters.

>Also, on some binary "grabbers", there are options like "read nn number of
>lines to determine if post is binary", where nn is a number that can be
>entered (usually defaulting to 50).

I'm actually implementing a feature to lockout clients which are doing this.
NNTP does actually not permit to fetch partial articles.

> I am assuming that this is the first nn lines of the body.  Would that mean
>the grabber is getting the entire post in a group (unless there is a way to
>get the first nn lines of an article)?  Getting every post would effectively
>mean it is downloading all the binaries in the group, which is not the case.

You cannot fetch 10.000 partial articles. This takes hours.


Short tips:

The best current way to fetch binaries from the Usenet is actually
to evaluate the subject line. If you are finding filenames there
(or the message is large enough) then it contains a binary 
(in most cases). yEncoded messages have the filename enclosed
in quotes.
Multiparts are indicated by  (2/7)  - with round brackets.
MultiPosts (many files) are indicated by  [3/200] - with square brackets
Dont try try to download incomplete multiparts. This is a waste of time.

Posts without a filename (check for the extension type:  .jpg  .rm  .mp3 .rar ..)
are almost crap.


You'll need a few weeks/months of experience to find out that writing 
automatic binary downloaders is hard work. 


If you're just looking for a program yourself, then use one of the existing
programs. BNR, Super Gravity, MyNews, ... There is enough freeware.

If you want to create a program professionally to sell it:
Better find another market segment. Becoming better than the existing
programs and companies takes 2-3 years. Your chances to succeed
are very low. Usenet is not 'just another Internet app' - but a very 
special method to distribute news. I needed four years to have MyNews
where it is today.

Good luck.
-- 
Juergen

Re: Suggestings for NNTP command with attachment app
#64221
Author: DS
Date: Sat, 01 Mar 2003 23:12
50 lines
3104 bytes
> Multiparts are indicated by  (2/7)  - with round brackets.
> MultiPosts (many files) are indicated by  [3/200] - with square
> brackets Dont try try to download incomplete multiparts. This is a
> waste of time. 

Not to argue, but recent posts in some of the mp3 groups are using [x/x] 
at the subject end for multiparts. I just figured that into my code.

> 
> You'll need a few weeks/months of experience to find out that writing 
> automatic binary downloaders is hard work. 

Believe this !!!! Figured it would be hard after about a month, and I'm 
not even going to auto-download yet, that's later on. I think I just 
passed the 6 month mark. Probably another six go.

 
> If you're just looking for a program yourself, then use one of the
> existing programs. BNR, Super Gravity, MyNews, ... There is enough
> freeware.

I wouldn't be writing my own if there were any good ones (IMO) to use.

> 
> If you want to create a program professionally to sell it:
> Better find another market segment. Becoming better than the existing
> programs and companies takes 2-3 years. Your chances to succeed
> are very low. Usenet is not 'just another Internet app' - but a very 
> special method to distribute news. I needed four years to have MyNews
> where it is today.

Jeurgen, why didn't you tell me that ? Not that I would have listened 
anyway. I tried them all. All have their strength's, all have their 
weaknesses. I am trying to get the best feature's from all and wrap them 
into one package.

And again, you are one of the regulars that has helped me out a lot in 
the past, and I thank you, for w/o all of you, I wouldn't be nearly as 
far as I am today.


Regards,

DS


-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------
   http://www.newsfeed.com       The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
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