Changes to news:* handleing
montulli@stat1.cc.ukans.edu (Lou Montulli)
Errors-To: postmaster@www0.cern.ch
Date: Tue, 15 Feb 1994 12:18:46 --100
Message-id: <9402112338.AA28524@stat1.cc.ukans.edu>
Errors-To: postmaster@www0.cern.ch
Reply-To: montulli@stat1.cc.ukans.edu
Originator: www-talk@info.cern.ch
Sender: www-talk@www0.cern.ch
Precedence: bulk
From: montulli@stat1.cc.ukans.edu (Lou Montulli)
To: Multiple recipients of list <www-talk@www0.cern.ch>
Subject: Changes to news:* handleing
X-Listprocessor-Version: 6.0c -- ListProcessor by Anastasios Kotsikonas
Content-Length: 4321
Our local news guru (Bob Sloan) pointed out to me that the Web use
of "LIST" to retrieve all the articles on the system was rather ugly
and that what we should be using is "LIST NEWSGROUPS". "LIST"
returns the name of each group plus the last article number and
the first article number and then a moderated code. "LIST" looks like:
NEWSGROUPS
* alt.3d 5025 4760 y
* alt.abortion.inequity 12827 12537 y
* alt.abuse-recovery 2 3 m
* alt.activism 60722 60194 y
Pretty darn ugly. "LIST NEWSGROUPS" returns the name of each
newsgroup and a description. With some slight code changes
we now get:
NEWSGROUPS
alt.3d
Three-dimensional imaging.
alt.abortion.inequity
Paternal obligations of failing to abort unwanted child.
alt.abuse-recovery
Companion to alt.sexual.abuse.recovery. (Moderated)
alt.activism
Activities for activists.
I have attached code diffs for both the Lynx version of
the WWW library changes and the XMosaic 2.2 version, since
there are differneces in the file. I will have these changes
in Lynx version 2.2
Does anyone know of any server that doesn't support "LIST NEWSGROUPS"
I tried INN, ANU News and a CNEWS installation and they all worked.
:lou
------ Diffs to Lynx version of Libwww 2.1 HTNews.c -------------
602c602
< (*targetClass.start_element)(target, HTML_DL , 0, 0);
---
> (*targetClass.start_element)(target, HTML_MENU , 0, 0);
612c612
< (*targetClass.start_element)(target, HTML_DT , 0, 0);
---
> (*targetClass.start_element)(target, HTML_LI , 0, 0);
624,637c624,630
< int i=0;
<
< /* find whitespace if it exits */
< for(; line[i] != '\0' && !WHITE(line[i]); i++)
< ; /* null body */
<
< if(line[i] != '\0') {
< line[i] = '\0';
< write_anchor(line, line);
< (*targetClass.start_element)(target, HTML_DD , 0, 0);
< PUTS(&line[i+1]); /* put description */
< } else {
< write_anchor(line, line);
< }
---
> char group[LINE_LENGTH];
> int first, last;
> char postable;
> if (sscanf(line, "%s %d %d %c", group, &first, &last, &postable)==4)
> write_anchor(line, group);
> else
> PUTS(line);
642c635
< (*targetClass.end_element)(target, HTML_DL);
---
> (*targetClass.end_element)(target, HTML_MENU);
955c948
< strcpy(command, "LIST NEWSGROUPS");
---
> strcpy(command, "LIST ");
-------- Diffs to XMosaic 2.2 version of HTNews.c ---------
479c479
< (*targetClass.start_element)(target, HTML_DL , 0, 0);
---
> (*targetClass.start_element)(target, HTML_MENU , 0, 0);
489c489
< (*targetClass.start_element)(target, HTML_DT , 0, 0);
---
> (*targetClass.start_element)(target, HTML_LI , 0, 0);
501,514c501,507
< int i=0;
< /* find whitespace if it exits */
< for(; line[i] != '\0' && !WHITE(line[i]); i++)
< ; /* null body */
<
< if(line[i] != '\0') {
< line[i] = '\0';
< write_anchor(line, line);
< (*targetClass.start_element)(target, HTML_DD , 0, 0);
< PUTS(&line[i+1]); /* put description */
< } else {
< write_anchor(line, line);
< }
<
---
> char group[LINE_LENGTH];
> int first, last;
> char postable;
> if (sscanf(line, "%s %d %d %c", group, &first, &last, &postable)==4)
> write_anchor(line, group);
> else
> PUTS(line);
519c512
< (*targetClass.end_element)(target, HTML_DL);
---
> (*targetClass.end_element)(target, HTML_MENU);
755c748
< strcpy(command, "LIST NEWSGROUPS");
---
> strcpy(command, "LIST ");
--
**************************************************************************
* T H E U N I V E R S I T Y O F K A N S A S *
* Lou MONTULLI @ Ukanaix.cc.ukans.edu *
* Kuhub.cc.ukans.edu ACS Computing Services *
* 913/864-0436 Ukanvax.bitnet Lawrence, KS 66044 *
* UNIX! Cool! I know that! Jurassic Park - The Movie *
**************************************************************************