🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #3403

Re: Suck/Poll News

#3403
From: Mail Account for root
Date: Tue, 28 Feb 1995 12:02
81 lines
4632 bytes
Mail Account for root (rootmail@btoy1.rochester.ny.us) wrote:
: After so many request for it I decided to post my package "nntppoll". It is
: a tool that allows you to poll news from a nntp server and post it locally.
: The package is based on the package "suck" - in fact it reuses quite a bit
: of it's code - but is faster and more monolithic.

: I provide the package as-is without any written or implicit warranty. I use
: it myself of a linux system and have tested it only there - but porting
: shouldn't be too difficult.

Okay - and here are some additional patches:

--- nntppoll.c.1.2	Tue Feb 28 06:16:52 1995
+++ nntppoll.c	Tue Feb 28 06:10:02 1995
@@ -6,6 +6,9 @@
  * 1.1  25-Jan-1995 TB  Unit-tested
  * 1.2  25-Feb-1995 TB  Make sure that all return values are reported
  *                       correctly
+ * 1.3  28-Feb-1995 TB  Applied some patches from Stephen Harris
+ *                       (sweh@spuddy.mew.co.uk) to filter out
+ *                       duplicate messages
  ********************************************************************/
 
 /* Includes */
@@ -253,8 +256,8 @@
     if (NoArticles > 0)
     {
         /* Yes -> Sort the message IDs and remove duplicates */
-        sprintf (SysCmd, "sort -u /tmp/nntppoll.index.%d > /tmp/nntppoll.sorted.%d",
-                         PID, PID);
+         sprintf(SysCmd, "sort -t" " +2 /tmp/nntppoll.index.%d | awk '$3!=old {old=$3 ; print $0}' | sort > /tmp/nntppoll.sorted.%d",
+                           PID, PID);
         if (VerboseFlag)
             printf ("%s: Removing duplicates of message IDs\n", ProgName);
         system (SysCmd);
@@ -426,7 +429,7 @@
                             if (TempBuf[0] != '.')
                             {
                                 for (sp = TempBuf; *sp != '<'; sp++);
-                                fprintf (IndexFile, "%s\n", sp);
+                                 fprintf (IndexFile, "%s %s\n", GroupName, sp);
                                 NoArticles++;
                             }   /* end if TempBuf[0] */
                         } while (TempBuf[0] != '.' || TempBuf[1] != '\0');
@@ -461,7 +464,8 @@
     char            TempBuffer1[TEMPBUF_LEN],
                     TempBuffer2[TEMPBUF_LEN],
                     FileName[TEMPBUF_LEN / 4],
-                    MsgIDLine[TEMPBUF_LEN / 2];
+                    MsgIDLine[TEMPBUF_LEN / 2],
+                    *sp;
     int             Response, Len;
     FILE            *SortedFile,
                     *Rnews;
@@ -493,7 +497,10 @@
             }   /* end if Rnews */
 
             /* Format the command and send it */
-            sprintf (TempBuffer1, "article %s\r\n", MsgIDLine);
+            sp=MsgIDLine;
+            while (*sp && (*sp!='<'))
+             sp++;
+            sprintf (TempBuffer1, "article %s\r\n", sp);
             sputs (SockFD, TempBuffer1);
 
             /* Get the response code */
--- nntppoll.h.1.2	Tue Feb 28 06:16:58 1995
+++ nntppoll.h	Tue Feb 28 06:10:22 1995
@@ -5,7 +5,7 @@
 struct hostent *hi;
 
 /* Global defines */
-#define VERSION     "1.2, 25-Feb-1995"
+#define VERSION     "1.3, 28-Feb-1995"
 #define TEMPBUF_LEN 1024
 #define RNEWS       "/usr/lib/news/rnews"
-- 
--______ __ ---------------------------------------------------------
 '  /  '/  )  This is the mail account for ROOT@BTOY1.ROCHESTER.NY.US
   /   /--<    btoy1 is a system running LINUX on a 386DX/40Mhz
(_/   /___/
Technical Details
Message-ID: <3iv3dj$pga@btoy1.btoy1.rochester.ny.us>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.sources.mbox.zip!nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!news.rz.uni-ulm.de!zib-berlin.de!news.mathworks.com!usenet.eel.ufl.edu!news-feed-1.peachnet.edu!gatech!howland.reston.ans.net!news.sprintlink.net!uhost1.servtech.com!btoy1.rochester.ny.us!not-for-mail
References: <3iokfq$47u@btoy1.btoy1.rochester.NY.US>

Show Full Headers
Complete Article Headers
Message-ID: <3iv3dj$pga@btoy1.btoy1.rochester.ny.us>
Subject: Re: Suck/Poll News
Date: Tue, 28 Feb 1995 12:02:59 +0000
From: rootmail@btoy1.rochester.ny.us (Mail Account for root)
References: <3iokfq$47u@btoy1.btoy1.rochester.NY.US>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.sources.mbox.zip!nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!news.rz.uni-ulm.de!zib-berlin.de!news.mathworks.com!usenet.eel.ufl.edu!news-feed-1.peachnet.edu!gatech!howland.reston.ans.net!news.sprintlink.net!uhost1.servtech.com!btoy1.rochester.ny.us!not-for-mail
Newsgroups: alt.sources,comp.os.linux.networking,news.software.nntp
Followup-To: alt.sources,comp.os.linux.networking,news.software.nntp
Organization: A private site
Lines: 81
Distribution: world
Reply-To: rootmail@btoy1.rochester.ny.us
NNTP-Posting-Host: btoy1.btoy1.rochester.ny.us
X-Newsreader: TIN [version 1.2 PL2]