Import Oort Gnus v0.16.
[elisp/gnus.git-] / lisp / nnrss.el
1 ;;; nnrss.el --- interfacing with RSS
2 ;; Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
3
4 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
5 ;; Keywords: RSS
6
7 ;; This file is part of GNU Emacs.
8
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published
11 ;; by the Free Software Foundation; either version 2, or (at your
12 ;; option) any later version.
13
14 ;; GNU Emacs is distributed in the hope that it will be useful, but
15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 ;; General Public License for more details.
18
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 ;; Boston, MA 02111-1307, USA.
23
24 ;;; Commentary:
25
26 ;;; Code:
27
28 (eval-when-compile (require 'cl))
29
30 (require 'gnus)
31 (require 'nnoo)
32 (require 'nnmail)
33 (require 'message)
34 (require 'mm-util)
35 (require 'gnus-util)
36 (require 'time-date)
37 (require 'rfc2231)
38 (require 'mm-url)
39 (eval-when-compile
40   (ignore-errors
41     (require 'xml)))
42 (eval '(require 'xml))
43
44 (nnoo-declare nnrss)
45
46 (defvoo nnrss-directory (nnheader-concat gnus-directory "rss/")
47   "Where nnrss will save its files.")
48
49 ;; (group max rss-url)
50 (defvoo nnrss-server-data nil)
51
52 ;; (num timestamp url subject author date extra)
53 (defvoo nnrss-group-data nil)
54 (defvoo nnrss-group-max 0)
55 (defvoo nnrss-group-min 1)
56 (defvoo nnrss-group nil)
57 (defvoo nnrss-group-hashtb nil)
58 (defvoo nnrss-status-string "")
59
60 (defconst nnrss-version "nnrss 1.0")
61
62 (defvar nnrss-group-alist
63   '(("MacWeek"
64      "http://macweek.zdnet.com/macweek.xml"
65      "The Macintosh news authority.")
66     ("Linux.Weekly.News"
67      "http://lwn.net/headlines/rss")
68     ("Motley.Fool"
69      "http://www.fool.com/About/headlines/rss_headlines.asp")
70     ("NewsForge.rdf"
71      "http://www.newsforge.com/newsforge.rdf")
72     ("Slashdot"
73      "http://www.slashdot.com/slashdot.rdf")
74     ("CNN"
75      "http://www.cnn.com/cnn.rss"
76      "The world's news leader.")
77     ("FreshMeat"
78      "http://freshmeat.net/backend/fm-releases.rdf"
79      "The one-stop-shop for all your Linux software needs.")
80     ("The.Guardian.newspaper"
81      "http://www.guardianunlimited.co.uk/rss/1,,,00.xml"
82      "Intelligent news and comment throughout the day from The Guardian newspaper.")
83     ("MonkeyFist.rdf"
84      "http://monkeyfist.com/rdf.php3"
85      "News and opinion on politics, technology, and eclectic miscellany.")
86     ("NewsForge"
87      "http://www.newsforge.com/newsforge.rss")
88     ("Reuters.Health"
89      "http://www.reutershealth.com/eline.rss"
90      "Consumer-oriented health-related news stories.")
91     ("Salon"
92      "http://www.salon.com/feed/RDF/salon_use.rdf")
93     ("Wired"
94      "http://www.wired.com/news_drop/netcenter/netcenter.rdf")
95     ("ITN"
96      "http://www.itn.co.uk/itn.rdf")
97     ("Meerkat"
98      "http://www.oreillynet.com/meerkat/?_fl=rss10"
99      "An Open Wire Service")
100     ("MonkeyFist"
101      "http://monkeyfist.com/rss1.php3"
102      "News and opinion on politics, technology, and eclectic miscellany.")
103     ("Reuters.Health.rdf"
104      "http://www.reutershealth.com/eline.rdf"
105      "Consumer-oriented health-related news stories.")
106     ("Aaronland" "http://aaronland.net/xml/abhb.rdf" "A boy and his basement.")
107     ("Art of the Mix" "http://www.artofthemix.org/xml/rss.asp" "A website devoted to the art of making mixed tapes and cds.")
108     ("Dave Beckett's RDF Resource Guide" "http://www.ilrt.bristol.ac.uk/discovery/rdf/resources/rss.rdf" "A comprehensive guide to resources about RDF.")
109     ("David Chess" "http://www.davidchess.com/words/log.rss" "Mostly-daily musings on philosophy, children, culture, technology, the emergence of life from matter, chocolate, Nomic, and all that sort of thing.")
110     ("Figby Articles" "http://www.figby.com/index-rss.php" "A weblog with daily stories about technology, books and publishing, privacy, science, and occasional humor.")
111     ("Figby Quickies" "http://www.figby.com/quickies-rss.php" "Quick commented links to other sites from Figby.com.")
112     ("Flutterby!" "http://www.flutterby.com/main.rdf" "News and views from Dan Lyke.")
113     ("Groovelog" 
114      "http://groovelog.agora.co.uk/groove+log/groovelog.nsf/today.rss.xml"
115      "The open-access groove users' weblog.")
116     ("Hit or Miss" "http://hit-or-miss.org/rss/" "Daily weblog and journal.")
117     ("Larkfarm News" "http://www.larkfarm.com/Larkfarm.rdf" "Mike Gunderloy's web site.")
118     ("Latest RFCs" "http://x42.com/rss/rfc.rss")
119     ("Linux Today" "http://linuxtoday.com/backend/biglt.rss")
120     ("Linux Today.rdf" "http://linuxtoday.com/backend/my-netscape10.rdf")
121     ("More Like This WebLog" "http://www.whump.com/moreLikeThis/RSS" "Because the more you know, the more jokes you get.")
122     ("Motivational Quotes of the Day" "http://www.quotationspage.com/data/mqotd.rss" "Four motivational quotations each day from the Quotations Page.")
123     ("Network World Fusion NetFlash" "http://www.nwfusion.com/netflash.rss" "Daily breaking news about networking products, technologies and services.")
124     ("News Is Free" "http://www.newsisfree.com/news.rdf.php3")
125     ("O'Reilly Network Articles" "http://www.oreillynet.com/cs/rss/query/q/260?x-ver=1.0")
126     ("Quotes of the Day" "http://www.quotationspage.com/data/qotd.rss" "Four humorous quotations each day from the Quotations Page.")
127     ("RDF Interest Group" "http://ilrt.org/discovery/rdf-dev/roads/cgi-bin/desire/ig2rss?list=www-rdf-interest" "An experimental channel scraped from the RDF Interest Group mail archives.")
128     ("RDF Logic List" "http://ilrt.org/discovery/rdf-dev/roads/cgi-bin/desire/ig2rss?list=www-rdf-logic" "An experimental channel scraped from the RDF Logic mail archives.")
129     ("RSS Info" "http://www.blogspace.com/rss/rss10" "News and information on the RSS format")
130     ("Semantic Web List"
131      "http://ilrt.org/discovery/rdf-dev/roads/cgi-bin/desire/ig2rss?list=semantic-web"
132      "An experimental channel scraped from the W3C's Semantic Web mail archives.")
133     ("W3C"
134      "http://www.w3.org/2000/08/w3c-synd/home.rss"
135      "The latest news at the World Wide Web Consortium.")
136     ("|fr| XMLfr" "http://xmlfr.org/actualites/general.rss10"
137      "French speaking portal site dedicated to XML.")
138     ("XMLhack" "http://xmlhack.com/rss10.php"
139      "Developer news from the XML community.")
140     ("The Register"
141      "http://www.theregister.co.uk/tonys/slashdot.rdf"
142      "The Register -- Biting the hand that feeds IT.")
143     ("|de| Heise-Ticker"
144      "http://www.heise.de/newsticker/heise.rdf"
145      "German news ticker about technology.")
146     ("|de| Telepolis News"
147      "http://www.heise.de/tp/news.rdf"
148      "German background news about technology.")
149     ("Kuro5hin"
150      "http://www.kuro5hin.org/backend.rdf"
151      "Technology and culture, from the trenches.")
152     ("Jabber Software Foundation News"
153      "http://www.jabber.org/news/rss.xml"
154      "News and announcements from the Jabber Software Foundation.")
155     ("MacRumors"
156      "http://www.macrumors.com/macrumors.xml"
157      "The mac news you care about.")
158     ("Mac OS X Hints"
159      "http://www.macosxhints.com/backend/geeklog.rdf"
160      "Mac OS X Hits.")
161     )
162   "List of RSS addresses.")
163
164 (defvar nnrss-use-local nil)
165
166 (defvar nnrss-description-field 'X-Gnus-Description
167   "Field name used for DESCRIPTION.
168 To use the description in headers, put this name into `nnmail-extra-headers'.")
169
170 (defvar nnrss-url-field 'X-Gnus-Url
171   "Field name used for URL.
172 To use the description in headers, put this name into `nnmail-extra-headers'.")
173
174 (defvar nnrss-content-function nil
175   "A function which is called in `nnrss-request-article'.
176 The arguments are (ENTRY GROUP ARTICLE).
177 ENTRY is the record of the current headline. GROUP is the group name.
178 ARTICLE is the article number of the current headline.")
179
180 (nnoo-define-basics nnrss)
181
182 ;;; Interface functions
183
184 (deffoo nnrss-retrieve-headers (articles &optional group server fetch-old)
185   (nnrss-possibly-change-group group server)
186   (let (e)
187     (save-excursion
188       (set-buffer nntp-server-buffer)
189       (erase-buffer)
190       (dolist (article articles)
191         (if (setq e (assq article nnrss-group-data))
192             (insert (number-to-string (car e)) "\t" ;; number
193                     (if (nth 3 e)
194                         (nnrss-format-string (nth 3 e)) "")
195                     "\t" ;; subject
196                     (if (nth 4 e)
197                         (nnrss-format-string (nth 4 e))
198                       "(nobody)")
199                     "\t" ;;from
200                     (or (nth 5 e) "")
201                     "\t" ;; date
202                     (format "<%d@%s.nnrss>" (car e) group)
203                     "\t" ;; id
204                     "\t" ;; refs
205                     "-1" "\t" ;; chars
206                     "-1" "\t" ;; lines
207                     "" "\t" ;; Xref
208                     (if (and (nth 6 e)
209                              (memq nnrss-description-field
210                                    nnmail-extra-headers))
211                         (concat (symbol-name nnrss-description-field)
212                                 ": "
213                                 (nnrss-format-string (nth 6 e))
214                                 "\t")
215                       "")
216                     (if (and (nth 2 e)
217                              (memq nnrss-url-field
218                                    nnmail-extra-headers))
219                         (concat (symbol-name nnrss-url-field)
220                                 ": "
221                                 (nnrss-format-string (nth 2 e))
222                                 "\t")
223                       "")
224                     "\n")))))
225   'nov)
226
227 (deffoo nnrss-request-group (group &optional server dont-check)
228   (nnrss-possibly-change-group group server)
229   (if dont-check
230       t
231     (nnrss-check-group group server)
232     (nnheader-report 'nnrss "Opened group %s" group)
233     (nnheader-insert
234      "211 %d %d %d %s\n" nnrss-group-max nnrss-group-min nnrss-group-max
235      (prin1-to-string group)
236      t)))
237
238 (deffoo nnrss-close-group (group &optional server)
239   t)
240
241 (deffoo nnrss-request-article (article &optional group server buffer)
242   (nnrss-possibly-change-group group server)
243   (let ((e (assq article nnrss-group-data))
244         (nntp-server-buffer (or buffer nntp-server-buffer))
245         post err)
246     (when e
247       (catch 'error
248         (with-current-buffer nntp-server-buffer
249           (erase-buffer)
250           (goto-char (point-min))
251           (if group
252               (insert "Newsgroups: " group "\n"))
253           (if (nth 3 e)
254               (insert "Subject: " (nnrss-format-string (nth 3 e)) "\n"))
255           (if (nth 4 e)
256               (insert "From: " (nnrss-format-string (nth 4 e)) "\n"))
257           (if (nth 5 e)
258               (insert "Date: " (nnrss-format-string (nth 5 e)) "\n"))
259           (insert "Message-ID: " (format "<%d@%s.nnrss>" (car e) group) "\n")
260           (insert "\n")
261           (if (nth 6 e)
262               (let ((point (point)))
263                 (insert (nnrss-string-as-multibyte (nth 6 e)))
264                 (goto-char point)
265                 (while (search-forward "\n" nil t)
266                   (delete-char -1))
267                 (goto-char (point-max))
268                 (insert "\n\n")
269                 (fill-region point (point))))
270           (if (nth 2 e)
271               (insert (nth 2 e) "\n"))
272           (if nnrss-content-function
273               (funcall nnrss-content-function e group article)))))
274     (cond
275      (err
276       (nnheader-report 'nnrss err))
277      ((not e)
278       (nnheader-report 'nnrss "No such id: %d" article))
279      (t
280       (nnheader-report 'nnrss "Article %s retrieved" (car e))
281       ;; We return the article number.
282       (cons nnrss-group (car e))))))
283
284 (deffoo nnrss-request-list (&optional server)
285   (nnrss-possibly-change-group nil server)
286   (nnrss-generate-active)
287   t)
288
289 (deffoo nnrss-open-server (server &optional defs connectionless)
290   (nnrss-read-server-data server)
291   (nnoo-change-server 'nnrss server defs)
292   t)
293
294 (deffoo nnrss-request-expire-articles
295     (articles group &optional server force)
296   (nnrss-possibly-change-group group server)
297   (let (e days not-expirable changed)
298     (dolist (art articles)
299       (if (and (setq e (assq art nnrss-group-data))
300                (nnmail-expired-article-p
301                 group
302                 (if (listp (setq days (nth 1 e))) days
303                   (days-to-time (- days (time-to-days '(0 0)))))
304                 force))
305           (setq nnrss-group-data (delq e nnrss-group-data)
306                 changed t)
307         (push art not-expirable)))
308     (if changed
309         (nnrss-save-group-data group server))
310     not-expirable))
311
312 (deffoo nnrss-request-delete-group (group &optional force server)
313   (nnrss-possibly-change-group group server)
314   (setq nnrss-server-data
315         (delq (assoc group nnrss-server-data) nnrss-server-data))
316   (nnrss-save-server-data server)
317   (let ((file (expand-file-name
318                (nnrss-translate-file-chars
319                 (concat group (and server
320                                    (not (equal server ""))
321                                    "-")
322                         server ".el")) nnrss-directory)))
323     (ignore-errors
324       (delete-file file)))
325   t)
326
327 (deffoo nnrss-request-list-newsgroups (&optional server)
328   (nnrss-possibly-change-group nil server)
329   (save-excursion
330     (set-buffer nntp-server-buffer)
331     (erase-buffer)
332     (dolist (elem nnrss-group-alist)
333       (if (third elem)
334           (insert (car elem) "\t" (third elem) "\n"))))
335   t)
336
337 (nnoo-define-skeleton nnrss)
338
339 ;;; Internal functions
340
341 (defun nnrss-possibly-change-group (&optional group server)
342   (when (and server
343              (not (nnrss-server-opened server)))
344     (nnrss-open-server server))
345   (when (and group (not (equal group nnrss-group)))
346     (nnrss-read-group-data group server)
347     (setq nnrss-group group)))
348
349 (defvar nnrss-extra-categories '(nnrss-snarf-moreover-categories))
350
351 (defun nnrss-generate-active ()
352   (if (y-or-n-p "Fetch extra categories? ")
353       (dolist (func nnrss-extra-categories)
354         (funcall func)))
355   (save-excursion
356     (set-buffer nntp-server-buffer)
357     (erase-buffer)
358     (dolist (elem nnrss-group-alist)
359       (insert (prin1-to-string (car elem)) " 0 1 y\n"))
360     (dolist (elem nnrss-server-data)
361       (unless (assoc (car elem) nnrss-group-alist)
362         (insert (prin1-to-string (car elem)) " 0 1 y\n")))))
363
364 ;;; Data functions
365
366 (defun nnrss-read-server-data (server)
367   (setq nnrss-server-data nil)
368   (let ((file (expand-file-name
369                (nnrss-translate-file-chars
370                 (concat "nnrss" (and server
371                                      (not (equal server ""))
372                                      "-")
373                         server
374                         ".el"))
375                nnrss-directory)))
376     (when (file-exists-p file)
377       (with-temp-buffer
378         (let ((coding-system-for-read 'binary)
379               emacs-lisp-mode-hook)
380           (insert-file-contents file)
381           (emacs-lisp-mode)
382           (goto-char (point-min))
383           (eval-buffer))))))
384
385 (defun nnrss-save-server-data (server)
386   (gnus-make-directory nnrss-directory)
387   (let ((file (expand-file-name
388                (nnrss-translate-file-chars
389                 (concat "nnrss" (and server
390                                      (not (equal server ""))
391                                      "-")
392                         server ".el"))
393                nnrss-directory)))
394     (let ((coding-system-for-write 'binary)
395           print-level print-length)
396       (with-temp-file file
397         (insert "(setq nnrss-group-alist '"
398                 (prin1-to-string nnrss-group-alist)
399                 ")\n")
400         (insert "(setq nnrss-server-data '"
401                 (prin1-to-string nnrss-server-data)
402                 ")\n")))))
403
404 (defun nnrss-read-group-data (group server)
405   (setq nnrss-group-data nil)
406   (setq nnrss-group-hashtb (gnus-make-hashtable))
407   (let ((pair (assoc group nnrss-server-data)))
408     (setq nnrss-group-max (or (cadr pair) 0))
409     (setq nnrss-group-min (+ nnrss-group-max 1)))
410   (let ((file (expand-file-name
411                (nnrss-translate-file-chars
412                 (concat group (and server
413                                    (not (equal server ""))
414                                    "-")
415                         server ".el"))
416                nnrss-directory)))
417     (when (file-exists-p file)
418       (with-temp-buffer
419         (let ((coding-system-for-read 'binary)
420               emacs-lisp-mode-hook)
421           (insert-file-contents file)
422           (emacs-lisp-mode)
423           (goto-char (point-min))
424           (eval-buffer)))
425       (dolist (e nnrss-group-data)
426         (gnus-sethash (nth 2 e) e nnrss-group-hashtb)
427         (if (and (car e) (> nnrss-group-min (car e)))
428             (setq nnrss-group-min (car e)))
429         (if (and (car e) (< nnrss-group-max (car e)))
430             (setq nnrss-group-max (car e)))))))
431
432 (defun nnrss-save-group-data (group server)
433   (gnus-make-directory nnrss-directory)
434   (let ((file (expand-file-name
435                (nnrss-translate-file-chars
436                 (concat group (and server
437                                    (not (equal server ""))
438                                    "-")
439                         server ".el"))
440                nnrss-directory)))
441     (let ((coding-system-for-write 'binary)
442           print-level print-length)
443       (with-temp-file file
444         (insert "(setq nnrss-group-data '"
445                 (prin1-to-string nnrss-group-data)
446                 ")\n")))))
447
448 ;;; URL interface
449
450 (defun nnrss-no-cache (url)
451   "")
452
453 (defun nnrss-insert-w3 (url)
454   (mm-with-unibyte-current-buffer
455     (mm-url-insert url)))
456
457 (defun nnrss-decode-entities-unibyte-string (string)
458   (mm-with-unibyte-buffer
459     (insert string)
460     (mm-url-decode-entities-nbsp)
461     (buffer-string)))
462
463 (defalias 'nnrss-insert 'nnrss-insert-w3)
464
465 (if (featurep 'xemacs)
466     (defalias 'nnrss-string-as-multibyte 'identity)
467   (defalias 'nnrss-string-as-multibyte 'string-as-multibyte))
468
469 ;;; Snarf functions
470
471 (defun nnrss-check-group (group server)
472   (let (file xml subject url extra changed author date)
473     (condition-case err
474         (mm-with-unibyte-buffer
475           (if (and nnrss-use-local
476                    (file-exists-p (setq file (expand-file-name
477                                               (nnrss-translate-file-chars
478                                                (concat group ".xml"))
479                                               nnrss-directory))))
480               (insert-file-contents file)
481             (setq url (or (nth 2 (assoc group nnrss-server-data))
482                           (second (assoc group nnrss-group-alist))))
483             (unless url
484               (setq url
485                     (read-string (format "RSS url of %s: " group "http://")))
486               (let ((pair (assoc group nnrss-server-data)))
487                 (if pair
488                     (setcdr (cdr pair) (list url))
489                   (push (list group nnrss-group-max url) nnrss-server-data)))
490               (setq changed t))
491             (nnrss-insert url))
492           (goto-char (point-min))
493           (while (re-search-forward "\r\n?" nil t)
494             (replace-match "\n"))
495           (goto-char (point-min))
496           (if (re-search-forward "<rdf\\|<rss" nil t)
497               (goto-char (match-beginning 0)))
498           (setq xml (xml-parse-region (point) (point-max))))
499       (error
500        (nnheader-message 1 "Error in group %s: %s" group (cadr err))))
501     (while (and xml (not (assq 'item xml)))
502       (setq xml (cddar xml))
503       (while (not (listp (car xml)))
504         (setq xml (cdr xml))))
505     (dolist (item (nreverse xml))
506       (when (and (listp item)
507                  (eq 'item (car item))
508                  (setq url (nnrss-node-text (assq 'link (cddr item))))
509                  (setq url (nnrss-decode-entities-unibyte-string url))
510                  (not (gnus-gethash url nnrss-group-hashtb)))
511         (setq subject (nnrss-node-text (assq 'title (cddr item))))
512         (setq extra (or (nnrss-node-text (assq 'description (cddr item)))
513                         (nnrss-node-text (assq 'dc:description (cddr item)))))
514         (setq author (nnrss-node-text (assq 'dc:creator (cddr item))))
515         (setq date (or (nnrss-node-text (assq 'dc:date (cddr item)))
516                        (message-make-date)))
517         (push
518          (list
519           (incf nnrss-group-max)
520           (current-time)
521           url
522           (and subject (nnrss-decode-entities-unibyte-string subject))
523           (and author (nnrss-decode-entities-unibyte-string author))
524           date
525           (and extra (nnrss-decode-entities-unibyte-string extra)))
526          nnrss-group-data)
527         (gnus-sethash url (car nnrss-group-data) nnrss-group-hashtb)
528         (setq changed t)))
529     (when changed
530       (nnrss-save-group-data group server)
531       (let ((pair (assoc group nnrss-server-data)))
532         (if pair
533             (setcar (cdr pair) nnrss-group-max)
534           (push (list group nnrss-group-max) nnrss-server-data)))
535       (nnrss-save-server-data server))))
536
537 (defun nnrss-generate-download-script ()
538   "Generate a download script in the current buffer.
539 It is useful when `(setq nnrss-use-local t)'."
540   (interactive)
541   (insert "#!/bin/sh\n")
542   (insert "WGET=wget\n")
543   (insert "RSSDIR='" (expand-file-name nnrss-directory) "'\n")
544   (dolist (elem nnrss-server-data)
545     (let ((url (or (nth 2 elem)
546                    (second (assoc (car elem) nnrss-group-alist)))))
547       (insert "$WGET -q -O \"$RSSDIR\"/'"
548               (nnrss-translate-file-chars (concat (car elem) ".xml"))
549               "' '" url "'\n"))))
550
551 (defun nnrss-translate-file-chars (name)
552   (let ((nnheader-file-name-translation-alist
553          (append nnheader-file-name-translation-alist '((?' . ?_)))))
554     (nnheader-translate-file-chars name)))
555
556 (defvar nnrss-moreover-url
557   "http://w.moreover.com/categories/category_list_rss.html"
558   "The url of moreover.com categories.")
559
560 (defun nnrss-snarf-moreover-categories ()
561   "Snarf RSS links from moreover.com."
562   (interactive)
563   (let (category name url changed)
564     (with-temp-buffer
565       (nnrss-insert nnrss-moreover-url)
566       (goto-char (point-min))
567       (while (re-search-forward
568               "<A NAME=\"\\([^\"]+\\)\">\\|<A HREF=\"\\(http://[^\"]*moreover\\.com[^\"]+page\\?c=\\([^\"&]+\\)&o=rss\\)" nil t)
569         (if (match-string 1)
570             (setq category (match-string 1))
571           (setq url (match-string 2)
572                 name (mm-url-decode-entities-string
573                       (rfc2231-decode-encoded-string
574                        (match-string 3))))
575           (if category
576               (setq name (concat category "." name)))
577           (unless (assoc name nnrss-server-data)
578             (setq changed t)
579             (push (list name 0 url) nnrss-server-data)))))
580     (if changed
581         (nnrss-save-server-data ""))))
582
583 (defun nnrss-format-string (string)
584   (gnus-replace-in-string (nnrss-string-as-multibyte string) " *\n *" " "))
585
586 (defun nnrss-node-text (node)
587   (if (and node (listp node))
588       (mapconcat 'nnrss-node-text (cddr node) "")
589     node))
590
591 (provide 'nnrss)
592
593 ;;; nnrss.el ends here