🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
3 messages
3 total messages Started by Don Cox (253-7121) Fri, 14 Dec 1990 16:26
Need to send articles to a new site
#847
Author: Don Cox (253-7121)
Date: Fri, 14 Dec 1990 16:26
33 lines
1965 bytes
How do I send all of the articles available in a select newsgroup to
a new site that I just agreed to be a newsfeed for?  I made the
necessary entries in /usr/lib/news/sys, added the nntpsend.sh to
the crontab, but now I want to send all 200 articles in a local
newsgroup to them.  I can (and did) create a file called 
machinename.abc.def.com in /var/spool/news/out.going
and added a line for each article ...  such as:

/usr/spool/news/ours/general/1
/usr/spool/news/ours/general/2
/usr/spool/news/ours/general/3
/usr/spool/news/ours/general/4
/usr/spool/news/ours/general/5
/usr/spool/news/ours/general/6
/usr/spool/news/ours/general/7
/usr/spool/news/ours/general/8
etc.

I tried a wildcard (*) instead of an article number, but it didn't
work.  How does one send hundreds of articles to a site without
typing in hundreds of entries?

Going one step further, I will be supplying all of the Usenet articles
to another site sometime in the near future.  How do I dump everything
that I have down to this site?

Thanks very much.
-- 
                  Don Cox
Phone (716) 253-7121      KMX (716) 253-7998
INTERNET    dcox@ssd.kodak.com
When an eel bites your leg, and the pain makes you beg, that's a moray!
Re: Need to send articles to a new site
#851
Author: Neil Rickert
Date: Fri, 14 Dec 1990 19:27
34 lines
2003 bytes
In article <1990Dec14.162617.5428@ssd.kodak.com> dcox@tweety.ssd.kodak.com (Don Cox (253-7121)) writes:
>How do I send all of the articles available in a select newsgroup to
>...
>newsgroup to them.  I can (and did) create a file called 
>machinename.abc.def.com in /var/spool/news/out.going
>and added a line for each article ...  such as:
>
>/usr/spool/news/ours/general/1
>/usr/spool/news/ours/general/2
>...
>/usr/spool/news/ours/general/8
>etc.
>
>I tried a wildcard (*) instead of an article number, but it didn't
>work.  How does one send hundreds of articles to a site without
>typing in hundreds of entries?
>
 Using the cshell, I would just do something like:

  foreach article ( [0-9]* )
  echo $cwd/$article >> $batchfile
  end

 Similar command sequences exist for other reasonable shells.

 Combining this with find, and a relatively simple sed filter
you should be able to do the whole news spooling directory with
very little effort.
-- 
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  Neil W. Rickert, Computer Science               <rickert@cs.niu.edu>
  Northern Illinois Univ.
  DeKalb, IL 60115.                                  +1-815-753-6940
Re: Need to send articles to a new site
#861
Author: blarson
Date: Tue, 18 Dec 1990 06:44
87 lines
3130 bytes
In article <1990Dec14.162617.5428@ssd.kodak.com> dcox@tweety.ssd.kodak.com (Don Cox (253-7121)) writes:
>How do I send all of the articles available in a select newsgroup to
>a new site that I just agreed to be a newsfeed for?

Here's a quick & dirty program I wrote to generate a file for use by
the C-News batcher from a "sendgroups" file.  "sendgroups" is like a
simplified .newsrc, each line is newsgroup: <last-article-seen> .
Just put newsgroup: on a new line to add another group.  Crossposted
articles will be sent multiple times, but C news handles this fine.
This does require a couple of routines from the C news library.


#include <stdio.h>
char *index();
char *strsave();

char *progname;

main(argc, argv)
int argc;
char **argv;
{
    FILE *act, *f, *fn;
    int i, l, first, last;
    char line[1024], actline[1024];
    char *cp, *group, *gd;

    progname = argv[0];
    if((act = fopen("/usr/lib/news/active", "r")) == NULL) {
	fprintf(stderr, "Can't open active\n");
	exit(1);
    }
    if((f = fopen("sendgroups", "r")) == NULL) {
	fprintf(stderr, "Can't open sendgroups\n");
	exit(1);
    }
    if((fn = fopen("sendgroups.new", "w")) == NULL) {
	fprintf(stderr, "Can't open sendgroups.new\n");
	exit(1);
    }
    while(fgets(line, 1024, f) != NULL) {
	if((cp = index(line, ':')) != NULL) {
	    l = cp - line;
	    *cp++ = '\0';
	    group = strsave(line);
	    i = atoi(cp) + 1;
	    fseek(act, 0, 0);
	    while(fgets(line, 1024, act) != NULL) {
		if(strncmp(line, group, l) == 0 &&
			(line[l]==' ' || line[l]=='\t')) {
		    sscanf(line, "%*s %d %d\n", &last, &first);
		    if(i <= last) {
		        gd = strsave(group);
			cp = gd;
			while(cp = index(cp, '.')) *cp++ = '/';
			if(i < first) i = first;
		    	for(; i <= last; i++) {
		    	    printf("/usr/spool/news/%s/%d\n", gd, i);
		    	}
			free(gd);
		    }
		    fprintf(fn, "%s: %d\n", group, last);
		    break;
		}
	    }
	    free(group);
	}
    }
    fclose(f);
    fclose(fn);
    rename("sendgroups", "sendgroups.old");
    rename("sendgroups.new", "sendgroups");
}

errunlock()
{
}

-- 
blarson@usc.edu
		C news and rn for os9/68k!
-- 
Bob Larson (blars)	blarson@usc.edu			usc!blarson
	Hiding differences does not make them go away.  Accepting
	differences makes them unimportant.
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