Article View: news.software.nntp
Article #3426Another suck
From: Tim Smith
Date: Mon, 06 Mar 1995 05:49
Date: Mon, 06 Mar 1995 05:49
242 lines
8769 bytes
8769 bytes
Charlie Root <goldt@math.tu-berlin.de> wrote: >Yep, it's true. I couldn't resist to include some more >patches, but still the job of maintaining suck is free >for YOU. >Grab suck 2.1 soon at sunsite.unc.edu in pub/Linux/system/Mail/news >and tsx-11.mit.edu in pub/linux/sources/sbin. Meanwhile, my suck is now at 2 also. You can get it at ftp://ftp.u.washington.edu/public/tzs/suck2.tar Here is an approximation of the README file from my current suck: -1. THERE IS A LOT SUCKING GOING ON There are now at least three versions of suck floating around. There is the original, which I wrote and made available last year. Someone took that, rewrote big chunks of it, and that apparently has shown up in some Linux distributions. Meanwhile, someone else based their new suck-like package on my suck, and I've seen that go by on news.software.nntp. 0. INTRODUCTION This package contains a set of programs for sucking news from an NNTP server. The target user is a person running Unix at home who wants to get a small newsfeed over a SLIP or PPP connection. It is assumed that you have INN or some other local news server running, so that suck will have something to do with the news that it fetches. Suck 2 contains the following improvements over Suck 1: 1. Source code is better organized, and more portable. 2. It is less monolithic. Instead of a single program to get the list of new articles and then get the articles, it is now two programs. One gets the list of new articles, and the other takes a list of articles and fetches them. 3. The news fetcher takes a time limit, and stops fetching when the time limit is reached. If your connection is one of those "on 2 hours/off 2 hours" types, this can keep you from getting hung up on. Sometime soon, I plan to release suck 3. The main change in suck 3 will be the use of XOVER rather than XHDR to get the list of new news articles, and the addition of a killfile mechanism, so you can avoid the waste of fetching articles that you don't want to read. The following several sections explain each program. Then there will be several sections explaining how to compile and install each program. 1. PROGRAM "findnew". This program finds new news on your server. Usage is findnew name_of_server The list of newsgroups you are interested in is kept in the file "suck.mark". The format of suck.mark is simple. It consists of lines of the form name_of_newsgroup NNNN where NNNN is the highest article number for the group. The output of a findnew run is two files: "suck.nmark" A copy of suck.mark, with the highest article numbers updated. "suck.new" A list of messages that need to be fetched from the server. 2. PROGRAM "fetchnews" This program actually grabs the articles. Usage is fetchnews timelimit name_of_server It takes as input the file "suck.need", which is a list of articles to fetch. While fetchnews is fetching news, it prints one line per article fetched. These lines look something like this: 90 <qualityD4wC17.K3q@netcom.com> The number is how many seconds remain before the timelimit is reached. The rest is the article ID of the last message fetched. It outputs two files: "suck.nneed" A list of articles from suck.need that it didn't get to. "suck.batch" A bunch of articles. 3. PROGRAM "lpost" This program reads "suck.batch" and feeds each article to the local server. 4. PROGRAM "mlock" AND SCRIPT "munlock" Simple locking programs that might be useful if you run this stuff out of cron. If you want to use the modem by hand for something, run "mlock", and suck will be prevented from stepping on you. Run "munlock" when you are done, and suck can run. 5. PROGRAMS "timestamp" AND "timelimit" The "timestamp" program simply prints a timestamp. The program "timelimit" takes a time limit and a start time, and computes how many seconds remain until the limit is reached. Usage is timelimit time_limit start_time For example, if you are want to limit your connect time to 90 minutes (5400 seconds), you would do something like this in your news suck script: START=`timestamp` ...connect to your server... ...use findnew to find new articles... LIMIT=`timelimit 5400 $START` ...use fetchnews to get the news, giving it $LIMIT for the time limit... 6. PROGRAMS "scall" AND "shangup" The "scall" program calls up a slip provider, logs in, and starts SLIP. The "shangup" program hangs up the phone. It will probably take a bit of work to use these on anything other than A/UX, since they know details of how to start a SLIP connected. 7. SCRIPT "sfetch" This puts it all together. Usage is sfetch There are a few comments in sfetch that explain what it is doing. 8. COMPILING AND INSTALLING Step 0: Make a directory somewhere to keep the suck runtime stuff. We'll call this ~/suck, but you can put it anywhere. Step 1: In the suck2.src directory, type "make". This will build findnew, fetchnews, timestamp, and timelimit. Move or copy these four files to ~/suck. Step 2: Edit sfetch and change the SERVER and MAXON definitions to what is appropriate for your system. Note that sfetch tries to "ping" the server to verify the connection. The arguments to ping vary from system to system, so you might need to change that line. Copy sfetch to ~/suck. Step 3: In the lpost.src directory, edit Makefile and change the definition of RNEWS to point to where you keep the rnews program. Type "make" to build lpost, and then copy lpost to ~/suck. Step 4: In lock.src, type "make" to make mlock. Copy mlock and munlock to ~/suck. Step 5: In connect.src, edit scall.c. Look at all the places where system() is called, and change these to issue the appropriate commands for your system. Also, take a careful look at the StartSLIP() function, for that is where the line from the provider that contains your and its IP addresses is parsed. You'll almost certainly have to hack this to match your providers' format, unless you are using the same SLIP provider I am (NorthWestNexus). You'll also need to fix shangup.c--look for system(). Note that you do not need scall and shangup to use suck. You can easily edit sfetch and change it to assume that the connection has already been set up. To compile scall and shangup, set environment variables PHONE, ACCOUNT, and PASSWORD to the phone number, account name, and password that are needed to log into your SLIP provider, and then type "make". This will build scall and shangup. Then move them to ~/suck. Note that scall might have to run as root on your system in order to start SLIP, so you may need to chown and chmod it to make it setuid root. Step 6: In ~/suck, make a suck.mark file that contains the groups you want to receive. Specify zero for the max article number for each group. For example, if you want to get comp.os.linux.misc and comp.os.linux.announce, you would put these lines in your suck.mark: comp.os.linux.misc 0 comp.os.linux.announce 0 I've included a simple script, "addgroup", that you can use to do this for you. Usage is addgroup name ... For each group, it will add it to suck.mark if it is not already there, and it will also notify INN. If you want to use addgroup, you'll probably have to change the ctlinnd, unless you keep it in the same place I do (/usr/local/news/bin/ctlinnd). 9. RUNNING SUCK Go to the directory where you installed the runtime files, and type sfetch When it finishes, take a look at suck.log for any errors or warnings. Note that "sfetch" saves backup copies of certain files. These have names of the form save.*. You can delete these periodically.
Technical Details
Message-ID:
<3je7oe$6m0@news.u.washington.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.os.linux.development.apps.mbox.zip!nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!RRZ.Uni-Koeln.DE!uni-duisburg.de!zib-berlin.de!news.mathworks.com!uunet!nntp.cac.washington.edu!tzsReferences:
<3j2k1f$hml@news.cs.tu-berlin.de>Show Full Headers
Complete Article Headers
Message-ID: <3je7oe$6m0@news.u.washington.edu> Subject: Another suck Date: Mon, 06 Mar 1995 05:49:02 +0000 From: tzs@u.washington.edu (Tim Smith) References: <3j2k1f$hml@news.cs.tu-berlin.de> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.os.linux.development.apps.mbox.zip!nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!RRZ.Uni-Koeln.DE!uni-duisburg.de!zib-berlin.de!news.mathworks.com!uunet!nntp.cac.washington.edu!tzs Newsgroups: comp.os.linux.development.apps,news.software.nntp Organization: University of Washington School of Law, Class of '95 Lines: 241 Distribution: inet NNTP-Posting-Host: nntp2.u.washington.edu