Burst the "alt" newsgroups listing

Ed Vielmetti emv at msen.com
Sat Jun 1 16:03:04 AEST 1991


Archive-name: burst-alt-newsgroups-listing/19910601

#!/usr/local/bin/perl

$igtopdir = "/u/msen/lib/ig-burst";	# customize here

# takes news at becker's "alt" newsgroups list and shreds it up.
# usage:
#	burst-alt-newsgroups-listing 199106 alt-newsgroups-listing
# this creates a bunch of directories with names like
#	a/a/alt.alt
#	a/s/alt.sex
# and drops one line onto the end of each corresponding to the
# appropriate newsgroup.
#
# a similar approach can be taken with any other periodic list that
# mentions a lot of newsgroups, like the arbitron ratings.  it can
# provide you with a convenient place for squirreling away information
# on just what is in a newsgroup (like a newsgroup charter, archive
# sites), in particular to get a sense from different commentators
# on what they see as important.
#
# it is suggested that commentators producing lists such as this one
# acknowlege that there are differing opinions on what constitutes
# an appropriate posting to any list or group.  diversity (oh, I love
# that word) in opinion on what is "right" and "appropriate" for a
# is to be expected.  by producing lists of this form that lend themselves
# to being shredded up, you too can participate in the continuing
# evolution of the net.
#
# Edward Vielmetti, emv at msen.com
# version 1.000
# bugs: doesn't check arguments very well 
#       doesn't work in a pipe
#       hashing scheme is non-obvious until you've dumped in a lot of groups
#	45 characters is not enough to describe a newsgroup.


$month = $ARGV[0];
open(REPORT,$ARGV[1]) || die "can't open report";
while (<REPORT>) {
     last if  /--------- 8< -/ ;
}

chdir($igtopdir) || die "no top directory! ";
while (<REPORT>) {
     next if /^[-]*$/;
     if (/^([a-z0-9.]+)(\s+)(.*)$/) {
	$group = $1;
	$blurb = $3;
	($first = $group) =~ s/^(.)(.*)$/\1/;
	($second = $group) =~ s/^[^\.]+\.(.)(.*)$/\1/;
	print "$group $first $second $blurb\n";
	-d "$first" || mkdir("$first",0755);
	-d "$first/$second" || mkdir("$first/$second",0755);
	-d "$first/$second/$group" || mkdir ("$first/$second/$group",0755);
	open(BLURB,">>$first/$second/$group/blurb-becker");
	print BLURB "$month $_";
	close(BLURB);
     }
}



More information about the Alt.sources mailing list