home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / alt / gopher / 1129 < prev    next >
Encoding:
Text File  |  1992-07-30  |  2.6 KB  |  88 lines

  1. Newsgroups: alt.gopher
  2. Path: sparky!uunet!stanford.edu!leland.Stanford.EDU!schemers
  3. From: schemers@leland.Stanford.EDU (Roland Schemers)
  4. Subject: g2nntp patch
  5. Message-ID: <1992Jul30.211714.16139@leland.Stanford.EDU>
  6. Sender: news@leland.Stanford.EDU (Mr News)
  7. Organization: Distributed Computing Group, Stanford University
  8. Date: Thu, 30 Jul 92 21:17:14 GMT
  9. Lines: 77
  10.  
  11. Here is a patch file for g2nntp. It allows you to grab the first or last
  12. article in a newsgroup. I might extend this concept further, and allow
  13. last-1, etc. This allows you to have a link like:
  14.  
  15. Name=Latest ClariNet Headlines
  16. Type=0
  17. Port=4320
  18. Host=slapshot.stanford.edu
  19. Path=nntp article clari.news.headlines last
  20.  
  21. Thanks to Jurgen Botz for the initial suggestion. I decided to use "first" and
  22. "last" instead of his suggestion of -1 as the last article.
  23.  
  24. The shar on boombox contains the patched version of g2nntp.
  25.  
  26. Roland
  27.  
  28. ps. Version numbers coming to a theater near you. :-)
  29.  
  30.  
  31. *** g2nntp    Thu Jul 30 13:35:59 1992
  32. --- g2nntp.new    Thu Jul 30 13:37:39 1992
  33. ***************
  34. *** 22,28 ****
  35.   # 
  36.   # ""                         -> list top level groups
  37.   # ls $group                  -> list group's articles and sub-groups
  38. ! # article $group $number     -> get 1 article
  39.   # sorry                      -> send sorry message
  40.   #
  41.   
  42. --- 22,28 ----
  43.   # 
  44.   # ""                         -> list top level groups
  45.   # ls $group                  -> list group's articles and sub-groups
  46. ! # article $group $number     -> get 1 article, number can be "last" or "first"
  47.   # sorry                      -> send sorry message
  48.   #
  49.   
  50. ***************
  51. *** 31,37 ****
  52.   
  53.     &do_ls("") if /^$/;
  54.     &do_ls($1) if /^ls\s+(.*)/i;
  55. !   &do_article($1,$2) if /^article\s+(\S+)\s+(\d+)/i;
  56.     &Gsorry if /^sorry$/;
  57.     &Gabort("Unknown command!");
  58.     exit;
  59. --- 31,37 ----
  60.   
  61.     &do_ls("") if /^$/;
  62.     &do_ls($1) if /^ls\s+(.*)/i;
  63. !   &do_article($1,$2) if /^article\s+(\S+)\s+(\S+)/i;
  64.     &Gsorry if /^sorry$/;
  65.     &Gabort("Unknown command!");
  66.     exit;
  67. ***************
  68. *** 46,51 ****
  69. --- 46,55 ----
  70.     &Gsend("GROUP $group");
  71.     $_ = &Grecv;
  72.     &Gabort($_) if !/^211/;
  73. +   ($n,$f,$l) = /211\s+(\d+)\s+(\d+)\s+(\d+)/;
  74. +   if ($number eq 'last')     { $number = $l; }
  75. +   elsif ($number eq 'first') { $number = $f; }
  76.   
  77.     &Gsend("ARTICLE $number");
  78.     $_ = &Grecv;
  79.  
  80.  
  81.  
  82. -- 
  83. Roland J. Schemers III              |            Networking Systems
  84. Systems Programmer                  |            168 Pine Hall   (415)-723-6740
  85. Distributed Computing Group         |            Stanford, CA 94305-4122
  86. Stanford University                 |            schemers@Slapshot.Stanford.EDU
  87.