* nnrss-generate-download-script
@ 2003-01-01 23:05 Jan Egil Hagen
2003-01-02 19:53 ` nnrss-generate-download-script Lars Magne Ingebrigtsen
0 siblings, 1 reply; 6+ messages in thread
From: Jan Egil Hagen @ 2003-01-01 23:05 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 324 bytes --]
I figured more people than me might be interested in this version of
nnrss-generate-download-script that downloads the RSS files in
parallel and generates the script in the nnrss directory rather than
inserting it in the current buffer. I've also changed a few uses of
second to nth 1 since second is from the cl package.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnrss.el.diff --]
[-- Type: text/x-patch, Size: 1659 bytes --]
167c167,169
< (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.")
182a185,192
>
> (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")
>
485c495
< (second (assoc group nnrss-group-alist))))
---
> (nth 1 (assoc group nnrss-group-alist))))
544,552c554,567
< (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)))
553a569
>
[-- Attachment #3: Type: text/plain, Size: 200 bytes --]
One other thing: I don't really /get/ nnoo, and this makes it a bit
difficult to understand the different back ends. Does any
documentation exist anywhere?
--
World works; done by its invalids
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: nnrss-generate-download-script
2003-01-01 23:05 nnrss-generate-download-script Jan Egil Hagen
@ 2003-01-02 19:53 ` Lars Magne Ingebrigtsen
2003-01-02 20:19 ` nnrss-generate-download-script Jan Egil Hagen
0 siblings, 1 reply; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-01-02 19:53 UTC (permalink / raw)
Jan Egil Hagen <janha+news@ifi.uio.no> writes:
> I figured more people than me might be interested in this version of
> nnrss-generate-download-script that downloads the RSS files in
> parallel and generates the script in the nnrss directory rather than
> inserting it in the current buffer. I've also changed a few uses of
> second to nth 1 since second is from the cl package.
Could you send a context diff instead of a plain patch? The latter
is kinda hard to read...
(diff --unified, for instance.)
> One other thing: I don't really /get/ nnoo, and this makes it a bit
> difficult to understand the different back ends. Does any
> documentation exist anywhere?
See the "Writing New Back Ends" node in the Gnus manual.
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: nnrss-generate-download-script
2003-01-02 19:53 ` nnrss-generate-download-script Lars Magne Ingebrigtsen
@ 2003-01-02 20:19 ` Jan Egil Hagen
2003-01-02 20:29 ` nnrss-generate-download-script Lars Magne Ingebrigtsen
0 siblings, 1 reply; 6+ messages in thread
From: Jan Egil Hagen @ 2003-01-02 20:19 UTC (permalink / raw)
[-- 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: nnrss-generate-download-script
2003-01-02 20:19 ` nnrss-generate-download-script Jan Egil Hagen
@ 2003-01-02 20:29 ` Lars Magne Ingebrigtsen
2003-01-02 20:37 ` nnrss-generate-download-script Jan Egil Hagen
0 siblings, 1 reply; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-01-02 20:29 UTC (permalink / raw)
Jan Egil Hagen <janha+news@ifi.uio.no> writes:
> +(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.")
Ok, looks good. Have you signed FSF copyright assignment papers?
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: nnrss-generate-download-script
2003-01-02 20:29 ` nnrss-generate-download-script Lars Magne Ingebrigtsen
@ 2003-01-02 20:37 ` Jan Egil Hagen
2003-01-02 20:39 ` nnrss-generate-download-script Lars Magne Ingebrigtsen
0 siblings, 1 reply; 6+ messages in thread
From: Jan Egil Hagen @ 2003-01-02 20:37 UTC (permalink / raw)
* Lars Magne Ingebrigtsen <larsi@gnus.org>
| Have you signed FSF copyright assignment papers?
No.
--
World works; done by its invalids
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: nnrss-generate-download-script
2003-01-02 20:37 ` nnrss-generate-download-script Jan Egil Hagen
@ 2003-01-02 20:39 ` Lars Magne Ingebrigtsen
0 siblings, 0 replies; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-01-02 20:39 UTC (permalink / raw)
Jan Egil Hagen <janha+news@ifi.uio.no> writes:
> | Have you signed FSF copyright assignment papers?
>
> No.
Ok, I'll send you some...
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-01-02 20:39 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` nnrss-generate-download-script Jan Egil Hagen
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
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).