home *** CD-ROM | disk | FTP | other *** search
/ YPA: Your Privacy Assured / YPA.ISO / other_goodies / utilities / iu-14-as225.lha / INetUtils-1.4 / contrib / stuff.rexx < prev    next >
OS/2 REXX Batch file  |  1994-10-04  |  4KB  |  121 lines

  1. Path: hearst.acc.Virginia.EDU!concert!inxs.ncren.net!taco.cc.ncsu.edu!lll-winken.llnl.gov!decwrl!hookup!yeshua.marcam.com!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!news.sprintlink.net!nwnexus!calvino.alaska.net!alaska.net!mitcht
  2. From: mitcht@alaska.net (Mitch Thompson)
  3. Newsgroups: comp.sys.amiga.networking
  4. Subject: Re: NNTP Posting utility
  5. Date: Mon, 03 Oct 1994 18:18:11 AST
  6. Organization: ""
  7. Lines: 107
  8. Message-ID: <zL0xv*310@alaska.net>
  9. References: <Cwyp91.5G8@news.ci.ua.pt>
  10. Reply-To: mitcht@alaska.net
  11. NNTP-Posting-Host: mitcht.alaska.net
  12. X-Newsreader: Arn V1.03a
  13.  
  14. In article <Cwyp91.5G8@news.ci.ua.pt>, Celso Martinho writes:
  15.  
  16. > I would like to know if anyone has wrote a NNTPPost-like program 
  17. > that supports batch files and not only one article at a time.
  18. > It would really make life easier for me. :)
  19. > Thanks in advance,
  20. > --
  21.  
  22. This works for me.  Run this script whenever you call for news:
  23.  
  24. getnews
  25. -----------------cut here----------------------------
  26.  
  27. ;First, trim old news posts out before calling for new mail.
  28. Hard:Nettools/PurgeNews ACTIVEFILE=UULIB:Active NP DATAFILE=UUNEWS:Purge.dat
  29. ; Next, set up connection.
  30. execute Amitcp:startppp
  31. wait 5 sec
  32. ;send news, if any.
  33.  
  34. list uunews:NNTPSpoolDir lformat="nntppost %p%n*ndelete %p%n" TO T:Post
  35. execute t:Post
  36. delete >NIL: T:Post
  37.  
  38.  
  39. ;<The above three lines are the ones you want.>
  40.  
  41. ;now, receive news.
  42. uucp:c/nntpxfer news.alaska.net uulib:active PARANOID
  43. ;Log off...
  44. amitcp:bin/stopnet
  45. wait 10
  46. ;Next, redo ARn's DataBase
  47. UUCP:c/arnmaster
  48. ;Finished!
  49.  
  50. ---------------------------cut here------------------------------
  51.  
  52. Also, in your newsreaders config file, use the following or equivalent to
  53. post mail to the UUNews:NNTPSPoolDir directory:
  54.  
  55. SENDNEWS rx rexx:nntpcopy.rexx %s
  56.  
  57. In Rexx:, have the following file:NNTPCopy.rexx
  58. ----------------------------cut here------------------------------
  59.  
  60. /*
  61.  * nntpcopy version 1.0
  62.  *
  63.  * ARexx script to copy a news article into uunews:NNTPSpoolDir
  64.  * A unique filename is created before copying the article 
  65.  * Usage: nntpcopy <article>
  66.  *
  67.  * Written by David Jameson, 1994.
  68.  */
  69.  
  70. arg args
  71.  
  72. /* Open RexxSupport library */
  73.  
  74. if ~show('L', 'rexxsupport.library') then do
  75.     if addlib('rexxsupport.library', 0, -30, 0) then
  76.         say 'added rexxsupport.library'
  77.     else do
  78.         say 'failed to open rexxsupport.library'
  79.         exit 10
  80.     end
  81. end
  82.  
  83. date = date()
  84. parse var date day month year
  85.  
  86. /* Remove leading spaces from year */
  87. year = right(year,4)
  88.  
  89. time = time()
  90. parse var time hour ':' min ':' sec
  91. filename = 'article.'||hour||'.'||min||'.'||sec||'.'||day||month||year
  92.  
  93. if exists('uunews:NNTPSpoolDir/'||filename) then do
  94.     say 'Error: temporary file already exists'
  95.     exit 20
  96. end
  97.  
  98. /* Copy file into NNTPSpoolDir */
  99.  
  100. address command
  101. 'copy' args 'uunews:NNTPSpoolDir/'||filename||' >t:'||filename
  102. ret_val = statef('t:'||filename)    /* major kludge... */
  103. parse var ret_val type size ignore
  104. if size ~= 0 then exit 10    /* copy failed */
  105. exit 0
  106. ---------------------------------cut here---------------------------
  107.  
  108.  
  109.  
  110. Please note!!!!  The above scripts (both DOS and REXX) are not mine!  I
  111. got them from AmiNET.  They are part of an archive what I no longer have,
  112. so I cannot remember who wrote them.  I am in no way taking credit for
  113. their creation, nor responsibility for any damage they may cause.  They
  114. work here.  The only problem I have with them is when I am posting mail to
  115. my news server, if it gets refused for any reason, it also gets deleted. 
  116. A minor annoyance.
  117.  
  118. Mitch Thompson
  119.