Article View: news.software.readers
Article #76789Re: Muliti-Part Posts
From: Curt Welch
Date: Tue, 17 Apr 2001 15:55
Date: Tue, 17 Apr 2001 15:55
154 lines
7959 bytes
7959 bytes
"Jack" <jkt@home.net> wrote: > On 16 Apr 2001 23:38:17 GMT, curt@kcwc.com (Curt Welch) wrote: > > >"Jack" <jkt@home.net> wrote: > >> I am trying to write my own newsreader. Some questions: > >> > >> (1) What's the most reliable way to find out if the post is multi-part > >> attachment? > > > >It's not easy. It's done mostly just by looking at the subject and then > >seeing if there are other articles with similar subjects posted by the > >same guy. There's a mime standard for multipart articles but it's not > >used much on Usenet. But if you want to be complete, you should support > >that as well. > > I want my program to automatically combine attachments (like Agent) > instead of cluttering the screen with parts. Here is an example from one > of the binaries newsgroup: > > Repost: LK Cisco CCNA 2 - Cd 1 of 5 - see (0/1) for posting nfo - > [09/28] - > LKCCNA2-cd1.r07 (08/45) > > Apparently the guy is trying to send a file, LKCCNA2-cd1.r07 in 45 parts. > By looking at the subject, how would your program decide if this is > multi-part post (45 parts in this case)? There are lots of stuff there -- > like [09/28], which probably indicates that the cd has 28 rars. The > program has to be real clever to not get confused due to (0/1), [09/28] > and (08/45) all of which appear in the subject. Like I said. It's not easy. But mostly, for the above problem, the best guess is to always go with the last set of numbers in the subject. But I've seen some posts that used one of the other sets of numbers. If you want to get everything, your program will have to try each. i.e., assume it's the last set, and see if you can find the 45 parts where the subject is the same but just the 8 in 8/45 changes. If you can't find a complete set that way, your program could then try the 9/28 and see if it could find the 28 parts, etc. I only used the last valid looking set of numbers in the subject. That gets almost everything correct. In C, it was about 100 lines of code just for parsing subjects. > You said I should look at other posts from the author when making a > decision if the post is mult-part, but if the guy gets disconnected after > sending 10 parts and resends rest of the parts using different name or > email, wouldn't relying on author in that case be a problem? Sure it would. But not using the From: will get you in a lot more problems. Bob Please re-send file.r01 Joe Re: Please re-send file.r01 (01/10) 1/10 data Bob Re: Please re-send file.r01 (01/10) <- Bob says Thanks! Joe Re: Please re-send file.r01 (01/10) <- Joe says you're welcome! Joe Re: Please re-send file.r01 (02/10) 2/10 data Joe Re: Please re-send file.r01 (03/10) 3/10 data .... If you don't check the From: address, you will have lots of problems. But you could try to check the from address, and if you end up with missing parts, then try to find it posted under a different name. > Another > problem, what if rest of 44 parts are missing and I have only the above > part? Nothing would be there to compare with. Then you don't have anything to do. You are missing 44 parts so what's the point of downloading anything? You only download the articles if you find what you think are all the parts. > The program must make a > decision whether the post is ordinary post with text or uuencoded post > that is missing parts (i.e., to prevent the user from wasting time by > downloading it). You have to figure out how to deal with that. If you don't download it now, it may be gone the next time you check but the other parts may then be there. If you only start the download if you have all the parts, then there is no problem. Either your program figured it out and found all the parts, or it couldn't figure it out in which case there's nothing to be done. > Another problem: If someone responds to the above post, the subject will > become > > Re: Repost: LK Cisco CCNA 2 - Cd 1 of 5 - see (0/1) for posting nfo - > [09/28] - > LKCCNA2-cd1.r07 (08/45) > > The only difference is "Re:". The program has to be clever Yes, the program has to be very clever. This stuff isn't designed to be machine readable. And the people who post this stuff have never tried to write a program to figure it out. It's hard. > to figure out > that this reply contains text and is not multi-part post which is missing > parts. (i.e. it shouldn't prevent the user from downloading it). Another > problem, what if the reply does indeed is uuencoded, posted as a fill to > the series? The program must figure that out! Yes it must. You also have the size of the article to work with BTW from the XOVER data. But I didn't feel that was ever needed. Mostly, the above stuff is figured out by matching both the Subject and the From. That's why I said you needed to do that. When people post multipart articles, all the subjects are the same (including the Re:) execept of course for the numbers, and all the From: addresses are the same. Also, you have to match up the number of parts as well. It's common for the same guy to post the same file twice with different sizes. So you see one set of subjects with 1/10, 2/10, 3/10, and another set with 1/19, 2/19, etc, but evertthing else is the same (rest of the subject and From:). > I think it is probably impossible to be 100% certain. For sure. The more code you write, the closer to 100% you can get. > But I want to know > how other newsreaders handle these problems. I can do what others do > (that would be easy). Can anyone explain in little detail how his program > handles the above cases? Like I said. It's not easy. With a problem like this the only way to attack it is to write code; see how well it works; Look at what it doesn't get correct; change code to make it better; repeat until it works good enough for you. Then, use it for years, fix problems that crop up as posting conventions change over time... Repeat till bored with the whole thing. :) But a place to start is to write code which can parse a subject and find and extract the last valid looking part number and part count. This code will also tell you whether the subject "looks" like a multipart article or not. Then write code to compare two subjects to see if they are the same expect for the part number. With that code to work with, you can then take a set of headers and try to match up the multipart articles. How that works depends on what else you are doing. Are you trying to thread aricles at the same time etc... -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Technical Details
Message-ID:
<20010417115519.461$4N@newsreader.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!supernews.google.com!sn-xit-03!supernews.com!hermes2.visi.com!news-out.visi.com!news-out.visi.com!hermes.visi.com!europa.netcrusader.net!205.252.116.205!howland.erols.net!portc.blue.aol.com.MISMATCH!portc01.blue.aol.com!feed.newsreader.com!news2.newsreader.com!flame.newsreader.com!not-for-mailReferences:
<ilrmdtkh8cmm2jpd1o6abgpvh29gq30vra@4ax.com> <20010416193817.627$0L@newsreader.com> <cdlndtgon044rr98it2fimcg1vspk6kj9e@4ax.com>Show Full Headers
Complete Article Headers
Message-ID: <20010417115519.461$4N@newsreader.com>
Subject: Re: Muliti-Part Posts
Date: Tue, 17 Apr 2001 15:55:19 +0000
From: curt@kcwc.com (Curt Welch)
References: <ilrmdtkh8cmm2jpd1o6abgpvh29gq30vra@4ax.com> <20010416193817.627$0L@newsreader.com> <cdlndtgon044rr98it2fimcg1vspk6kj9e@4ax.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!supernews.google.com!sn-xit-03!supernews.com!hermes2.visi.com!news-out.visi.com!news-out.visi.com!hermes.visi.com!europa.netcrusader.net!205.252.116.205!howland.erols.net!portc.blue.aol.com.MISMATCH!portc01.blue.aol.com!feed.newsreader.com!news2.newsreader.com!flame.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.readers
X-User: Curt@NewsReader.Com
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5
%IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Lines: 153