home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: alt.gopher
- Path: sparky!uunet!stanford.edu!leland.Stanford.EDU!schemers
- From: schemers@leland.Stanford.EDU (Roland Schemers)
- Subject: g2nntp patch
- Message-ID: <1992Jul30.211714.16139@leland.Stanford.EDU>
- Sender: news@leland.Stanford.EDU (Mr News)
- Organization: Distributed Computing Group, Stanford University
- Date: Thu, 30 Jul 92 21:17:14 GMT
- Lines: 77
-
- Here is a patch file for g2nntp. It allows you to grab the first or last
- article in a newsgroup. I might extend this concept further, and allow
- last-1, etc. This allows you to have a link like:
-
- Name=Latest ClariNet Headlines
- Type=0
- Port=4320
- Host=slapshot.stanford.edu
- Path=nntp article clari.news.headlines last
-
- Thanks to Jurgen Botz for the initial suggestion. I decided to use "first" and
- "last" instead of his suggestion of -1 as the last article.
-
- The shar on boombox contains the patched version of g2nntp.
-
- Roland
-
- ps. Version numbers coming to a theater near you. :-)
-
-
- *** g2nntp Thu Jul 30 13:35:59 1992
- --- g2nntp.new Thu Jul 30 13:37:39 1992
- ***************
- *** 22,28 ****
- #
- # "" -> list top level groups
- # ls $group -> list group's articles and sub-groups
- ! # article $group $number -> get 1 article
- # sorry -> send sorry message
- #
-
- --- 22,28 ----
- #
- # "" -> list top level groups
- # ls $group -> list group's articles and sub-groups
- ! # article $group $number -> get 1 article, number can be "last" or "first"
- # sorry -> send sorry message
- #
-
- ***************
- *** 31,37 ****
-
- &do_ls("") if /^$/;
- &do_ls($1) if /^ls\s+(.*)/i;
- ! &do_article($1,$2) if /^article\s+(\S+)\s+(\d+)/i;
- &Gsorry if /^sorry$/;
- &Gabort("Unknown command!");
- exit;
- --- 31,37 ----
-
- &do_ls("") if /^$/;
- &do_ls($1) if /^ls\s+(.*)/i;
- ! &do_article($1,$2) if /^article\s+(\S+)\s+(\S+)/i;
- &Gsorry if /^sorry$/;
- &Gabort("Unknown command!");
- exit;
- ***************
- *** 46,51 ****
- --- 46,55 ----
- &Gsend("GROUP $group");
- $_ = &Grecv;
- &Gabort($_) if !/^211/;
- + ($n,$f,$l) = /211\s+(\d+)\s+(\d+)\s+(\d+)/;
- +
- + if ($number eq 'last') { $number = $l; }
- + elsif ($number eq 'first') { $number = $f; }
-
- &Gsend("ARTICLE $number");
- $_ = &Grecv;
-
-
-
- --
- Roland J. Schemers III | Networking Systems
- Systems Programmer | 168 Pine Hall (415)-723-6740
- Distributed Computing Group | Stanford, CA 94305-4122
- Stanford University | schemers@Slapshot.Stanford.EDU
-