--- 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