home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3434 < prev    next >
Text File  |  1991-05-31  |  2KB  |  69 lines

  1. Newsgroups: alt.newgroup,alt.config,alt.sources
  2. From: emv@msen.com (Ed Vielmetti)
  3. Subject: Burst the "alt" newsgroups listing
  4. Message-ID: <EMV.91Jun1020301@bronte.aa.ox.com>
  5. Date: Sat, 1 Jun 1991 06:03:04 GMT
  6.  
  7.  
  8. Archive-name: burst-alt-newsgroups-listing/19910601
  9.  
  10. #!/usr/local/bin/perl
  11.  
  12. $igtopdir = "/u/msen/lib/ig-burst";    # customize here
  13.  
  14. # takes news@becker's "alt" newsgroups list and shreds it up.
  15. # usage:
  16. #    burst-alt-newsgroups-listing 199106 alt-newsgroups-listing
  17. # this creates a bunch of directories with names like
  18. #    a/a/alt.alt
  19. #    a/s/alt.sex
  20. # and drops one line onto the end of each corresponding to the
  21. # appropriate newsgroup.
  22. #
  23. # a similar approach can be taken with any other periodic list that
  24. # mentions a lot of newsgroups, like the arbitron ratings.  it can
  25. # provide you with a convenient place for squirreling away information
  26. # on just what is in a newsgroup (like a newsgroup charter, archive
  27. # sites), in particular to get a sense from different commentators
  28. # on what they see as important.
  29. #
  30. # it is suggested that commentators producing lists such as this one
  31. # acknowlege that there are differing opinions on what constitutes
  32. # an appropriate posting to any list or group.  diversity (oh, I love
  33. # that word) in opinion on what is "right" and "appropriate" for a
  34. # is to be expected.  by producing lists of this form that lend themselves
  35. # to being shredded up, you too can participate in the continuing
  36. # evolution of the net.
  37. #
  38. # Edward Vielmetti, emv@msen.com
  39. # version 1.000
  40. # bugs: doesn't check arguments very well 
  41. #       doesn't work in a pipe
  42. #       hashing scheme is non-obvious until you've dumped in a lot of groups
  43. #    45 characters is not enough to describe a newsgroup.
  44.  
  45.  
  46. $month = $ARGV[0];
  47. open(REPORT,$ARGV[1]) || die "can't open report";
  48. while (<REPORT>) {
  49.      last if  /--------- 8< -/ ;
  50. }
  51.  
  52. chdir($igtopdir) || die "no top directory! ";
  53. while (<REPORT>) {
  54.      next if /^[-]*$/;
  55.      if (/^([a-z0-9.]+)(\s+)(.*)$/) {
  56.     $group = $1;
  57.     $blurb = $3;
  58.     ($first = $group) =~ s/^(.)(.*)$/\1/;
  59.     ($second = $group) =~ s/^[^\.]+\.(.)(.*)$/\1/;
  60.     print "$group $first $second $blurb\n";
  61.     -d "$first" || mkdir("$first",0755);
  62.     -d "$first/$second" || mkdir("$first/$second",0755);
  63.     -d "$first/$second/$group" || mkdir ("$first/$second/$group",0755);
  64.     open(BLURB,">>$first/$second/$group/blurb-becker");
  65.     print BLURB "$month $_";
  66.     close(BLURB);
  67.      }
  68. }
  69.