Gnus development mailing list
 help / color / mirror / Atom feed
From: Jan Egil Hagen <janha+news@ifi.uio.no>
Subject: Re: nnrss-generate-download-script
Date: Thu, 02 Jan 2003 21:19:51 +0100	[thread overview]
Message-ID: <yaau1grfgns.fsf@sjau.ifi.uio.no> (raw)
In-Reply-To: <m365t7e3bk.fsf@quimbies.gnus.org>

[-- Attachment #1: Type: text/plain, Size: 249 bytes --]

* Lars Magne Ingebrigtsen <larsi@gnus.org>
| Could you send a context diff instead of a plain patch?  The latter
| is kinda hard to read...
| 
| (diff --unified, for instance.)

Sorry, --unified wasn't supported by the version of diff I was using.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnrss.el.diff --]
[-- Type: text/x-patch, Size: 2511 bytes --]

--- nnrss.el	Wed Jan  1 23:25:59 2003
+++ my-nnrss.el	Wed Jan  1 23:24:35 2003
@@ -164,7 +164,9 @@
      "News and announcements from the Jabber Software Foundation.")
     ))
 
-(defvar nnrss-use-local nil)
+(defvar nnrss-use-local nil 
+  "If true, don't download RSS feed if local version downloaded with
+the script generated by nnrss-generate-download-script exists.")
 
 (defvar nnrss-description-field 'X-Gnus-Description
   "Field name used for DESCRIPTION.
@@ -180,6 +182,14 @@
 ENTRY is the record of the current headline. GROUP is the group name.
 ARTICLE is the article number of the current headline.")
 
+
+(defvar nnrss-wget-command "wget"
+"The command used as wget in nnrss-generate-download-script")
+
+(defvar nnrss-generated-download-script-file 
+  (format "%s/download-script.sh" (expand-file-name nnrss-directory))
+"Where to place the script generated by nnrss-generate-download-script")
+
 (nnoo-define-basics nnrss)
 
 ;;; Interface functions
@@ -482,7 +492,7 @@
 					      nnrss-directory))))
 	      (insert-file-contents file)
 	    (setq url (or (nth 2 (assoc group nnrss-server-data))
-			  (second (assoc group nnrss-group-alist))))
+			  (nth 1 (assoc group nnrss-group-alist))))
 	    (unless url
 	      (setq url
 		    (read-string (format "RSS url of %s: " group "http://")))
@@ -541,15 +551,21 @@
   "Generate a download script in the current buffer.
 It is useful when `(setq nnrss-use-local t)'."
   (interactive)
-  (insert "#!/bin/sh\n")
-  (insert "WGET=wget\n")
-  (insert "RSSDIR='" (expand-file-name nnrss-directory) "'\n")
-  (dolist (elem nnrss-server-data)
-    (let ((url (or (nth 2 elem)
-		   (second (assoc (car elem) nnrss-group-alist)))))
-      (insert "$WGET -q -O \"$RSSDIR\"/'"
-	      (nnrss-translate-file-chars (concat (car elem) ".xml"))
-	      "' '" url "'\n"))))
+  (with-temp-buffer
+    (insert "#!/bin/sh\n")
+    (insert "WGET="  nnrss-wget-command "\n")
+    (insert "RSSDIR='" (expand-file-name nnrss-directory) "'\n")
+    (dolist (elem nnrss-server-data)
+      (let ((url (or (nth 2 elem)
+		     (nth 1 (assoc (car elem) nnrss-group-alist)))))
+	(insert "$WGET -q -O \"$RSSDIR\"/'"
+		(nnrss-translate-file-chars (concat (car elem) ".xml"))
+		"' '" url "' &\n")))
+    (insert "wait\n")
+    (write-region (point-min) (point-max) 
+		  nnrss-generated-download-script-file)
+    (set-file-modes nnrss-generated-download-script-file 448)))
+
 
 (defun nnrss-translate-file-chars (name)
   (let ((nnheader-file-name-translation-alist

[-- Attachment #3: Type: text/plain, Size: 180 bytes --]


| See the "Writing New Back Ends" node in the Gnus manual.

Thanks.  I will now stop trying to understand Oort with the 5.9.0
manual. :)

-- 
   World works; done by its invalids

  reply	other threads:[~2003-01-02 20:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-01 23:05 nnrss-generate-download-script Jan Egil Hagen
2003-01-02 19:53 ` nnrss-generate-download-script Lars Magne Ingebrigtsen
2003-01-02 20:19   ` Jan Egil Hagen [this message]
2003-01-02 20:29     ` nnrss-generate-download-script Lars Magne Ingebrigtsen
2003-01-02 20:37       ` nnrss-generate-download-script Jan Egil Hagen
2003-01-02 20:39         ` nnrss-generate-download-script Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yaau1grfgns.fsf@sjau.ifi.uio.no \
    --to=janha+news@ifi.uio.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).