;;; nnrss.el --- interfacing with RSS
-;; Copyright (C) 2001 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002 Free Software Foundation, Inc.
;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
;; Keywords: RSS
(eval-when-compile
(ignore-errors
(require 'xml)))
-;; Report failure to find w3 at load time if appropriate.
(eval '(require 'xml))
(nnoo-declare nnrss)
"Field name used for URL.
To use the description in headers, put this name into `nnmail-extra-headers'.")
+(defvar nnrss-content-function nil
+ "A function which is called in `nnrss-request-article'.
+The arguments are (ENTRY GROUP ARTICLE).
+ENTRY is the record of the current headline. GROUP is the group name.
+ARTICLE is the article number of the current headline.")
+
(nnoo-define-basics nnrss)
;;; Interface functions
(insert "\n\n")
(fill-region point (point))))
(if (nth 2 e)
- (insert (nth 2 e) "\n")))))
+ (insert (nth 2 e) "\n"))
+ (if nnrss-content-function
+ (funcall nnrss-content-function e group article)))))
(cond
(err
(nnheader-report 'nnrss err))
(when (file-exists-p file)
(with-temp-buffer
(let ((coding-system-for-read 'binary)
+ (input-coding-system 'binary)
emacs-lisp-mode-hook)
(insert-file-contents file)
(emacs-lisp-mode)
server ".el"))
nnrss-directory)))
(let ((coding-system-for-write 'binary)
+ (output-coding-system 'binary)
print-level print-length)
(with-temp-file file
+ (insert "(setq nnrss-group-alist '"
+ (prin1-to-string nnrss-group-alist)
+ ")\n")
(insert "(setq nnrss-server-data '"
(prin1-to-string nnrss-server-data)
")\n")))))
(when (file-exists-p file)
(with-temp-buffer
(let ((coding-system-for-read 'binary)
+ (input-coding-system 'binary)
emacs-lisp-mode-hook)
(insert-file-contents file)
(emacs-lisp-mode)
server ".el"))
nnrss-directory)))
(let ((coding-system-for-write 'binary)
+ (output-coding-system 'binary)
print-level print-length)
(with-temp-file file
(insert "(setq nnrss-group-data '"
(error
(nnheader-message 1 "Error in group %s: %s" group (cadr err))))
(while (and xml (not (assq 'item xml)))
- (unless (listp (car (setq xml (cddar xml))))
- (setq xml nil)))
+ (setq xml (cddar xml))
+ (while (not (listp (car xml)))
+ (setq xml (cdr xml))))
(dolist (item (nreverse xml))
(when (and (listp item)
(eq 'item (car item))