T-gnus 6.15.16 r00.
[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               (input-coding-system 'binary)
380               emacs-lisp-mode-hook)
381           (insert-file-contents file)
382           (emacs-lisp-mode)
383           (goto-char (point-min))
384           (eval-buffer))))))
385
386 (defun nnrss-save-server-data (server)
387   (gnus-make-directory nnrss-directory)
388   (let ((file (expand-file-name
389                (nnrss-translate-file-chars
390                 (concat "nnrss" (and server
391                                      (not (equal server ""))
392                                      "-")
393                         server ".el"))
394                nnrss-directory)))
395     (let ((coding-system-for-write 'binary)
396           (output-coding-system 'binary)
397           print-level print-length)
398       (with-temp-file file
399         (insert "(setq nnrss-group-alist '"
400                 (prin1-to-string nnrss-group-alist)
401                 ")\n")
402         (insert "(setq nnrss-server-data '"
403                 (prin1-to-string nnrss-server-data)
404                 ")\n")))))
405
406 (defun nnrss-read-group-data (group server)
407   (setq nnrss-group-data nil)
408   (setq nnrss-group-hashtb (gnus-make-hashtable))
409   (let ((pair (assoc group nnrss-server-data)))
410     (setq nnrss-group-max (or (cadr pair) 0))
411     (setq nnrss-group-min (+ nnrss-group-max 1)))
412   (let ((file (expand-file-name
413                (nnrss-translate-file-chars
414                 (concat group (and server
415                                    (not (equal server ""))
416                                    "-")
417                         server ".el"))
418                nnrss-directory)))
419     (when (file-exists-p file)
420       (with-temp-buffer
421         (let ((coding-system-for-read 'binary)
422               (input-coding-system 'binary)
423               emacs-lisp-mode-hook)
424           (insert-file-contents file)
425           (emacs-lisp-mode)
426           (goto-char (point-min))
427           (eval-buffer)))
428       (dolist (e nnrss-group-data)
429         (gnus-sethash (nth 2 e) e nnrss-group-hashtb)
430         (if (and (car e) (> nnrss-group-min (car e)))
431             (setq nnrss-group-min (car e)))
432         (if (and (car e) (< nnrss-group-max (car e)))
433             (setq nnrss-group-max (car e)))))))
434
435 (defun nnrss-save-group-data (group server)
436   (gnus-make-directory nnrss-directory)
437   (let ((file (expand-file-name
438                (nnrss-translate-file-chars
439                 (concat group (and server
440                                    (not (equal server ""))
441                                    "-")
442                         server ".el"))
443                nnrss-directory)))
444     (let ((coding-system-for-write 'binary)
445           (output-coding-system 'binary)
446           print-level print-length)
447       (with-temp-file file
448         (insert "(setq nnrss-group-data '"
449                 (prin1-to-string nnrss-group-data)
450                 ")\n")))))
451
452 ;;; URL interface
453
454 (defun nnrss-no-cache (url)
455   "")
456
457 (defun nnrss-insert-w3 (url)
458   (mm-with-unibyte-current-buffer
459     (mm-url-insert url)))
460
461 (defun nnrss-decode-entities-unibyte-string (string)
462   (mm-with-unibyte-buffer
463     (insert string)
464     (mm-url-decode-entities-nbsp)
465     (buffer-string)))
466
467 (defalias 'nnrss-insert 'nnrss-insert-w3)
468
469 (if (featurep 'xemacs)
470     (defalias 'nnrss-string-as-multibyte 'identity)
471   (defalias 'nnrss-string-as-multibyte 'string-as-multibyte))
472
473 ;;; Snarf functions
474
475 (defun nnrss-check-group (group server)
476   (let (file xml subject url extra changed author date)
477     (condition-case err
478         (mm-with-unibyte-buffer
479           (if (and nnrss-use-local
480                    (file-exists-p (setq file (expand-file-name
481                                               (nnrss-translate-file-chars
482                                                (concat group ".xml"))
483                                               nnrss-directory))))
484               (insert-file-contents file)
485             (setq url (or (nth 2 (assoc group nnrss-server-data))
486                           (second (assoc group nnrss-group-alist))))
487             (unless url
488               (setq url
489                     (read-string (format "RSS url of %s: " group "http://")))
490               (let ((pair (assoc group nnrss-server-data)))
491                 (if pair
492                     (setcdr (cdr pair) (list url))
493                   (push (list group nnrss-group-max url) nnrss-server-data)))
494               (setq changed t))
495             (nnrss-insert url))
496           (goto-char (point-min))
497           (while (re-search-forward "\r\n?" nil t)
498             (replace-match "\n"))
499           (goto-char (point-min))
500           (if (re-search-forward "<rdf\\|<rss" nil t)
501               (goto-char (match-beginning 0)))
502           (setq xml (xml-parse-region (point) (point-max))))
503       (error
504        (nnheader-message 1 "Error in group %s: %s" group (cadr err))))
505     (while (and xml (not (assq 'item xml)))
506       (setq xml (cddar xml))
507       (while (not (listp (car xml)))
508         (setq xml (cdr xml))))
509     (dolist (item (nreverse xml))
510       (when (and (listp item)
511                  (eq 'item (car item))
512                  (setq url (nnrss-node-text (assq 'link (cddr item))))
513                  (setq url (nnrss-decode-entities-unibyte-string url))
514                  (not (gnus-gethash url nnrss-group-hashtb)))
515         (setq subject (nnrss-node-text (assq 'title (cddr item))))
516         (setq extra (or (nnrss-node-text (assq 'description (cddr item)))
517                         (nnrss-node-text (assq 'dc:description (cddr item)))))
518         (setq author (nnrss-node-text (assq 'dc:creator (cddr item))))
519         (setq date (or (nnrss-node-text (assq 'dc:date (cddr item)))
520                        (message-make-date)))
521         (push
522          (list
523           (incf nnrss-group-max)
524           (current-time)
525           url
526           (and subject (nnrss-decode-entities-unibyte-string subject))
527           (and author (nnrss-decode-entities-unibyte-string author))
528           date
529           (and extra (nnrss-decode-entities-unibyte-string extra)))
530          nnrss-group-data)
531         (gnus-sethash url (car nnrss-group-data) nnrss-group-hashtb)
532         (setq changed t)))
533     (when changed
534       (nnrss-save-group-data group server)
535       (let ((pair (assoc group nnrss-server-data)))
536         (if pair
537             (setcar (cdr pair) nnrss-group-max)
538           (push (list group nnrss-group-max) nnrss-server-data)))
539       (nnrss-save-server-data server))))
540
541 (defun nnrss-generate-download-script ()
542   "Generate a download script in the current buffer.
543 It is useful when `(setq nnrss-use-local t)'."
544   (interactive)
545   (insert "#!/bin/sh\n")
546   (insert "WGET=wget\n")
547   (insert "RSSDIR='" (expand-file-name nnrss-directory) "'\n")
548   (dolist (elem nnrss-server-data)
549     (let ((url (or (nth 2 elem)
550                    (second (assoc (car elem) nnrss-group-alist)))))
551       (insert "$WGET -q -O \"$RSSDIR\"/'"
552               (nnrss-translate-file-chars (concat (car elem) ".xml"))
553               "' '" url "'\n"))))
554
555 (defun nnrss-translate-file-chars (name)
556   (let ((nnheader-file-name-translation-alist
557          (append nnheader-file-name-translation-alist '((?' . ?_)))))
558     (nnheader-translate-file-chars name)))
559
560 (defvar nnrss-moreover-url
561   "http://w.moreover.com/categories/category_list_rss.html"
562   "The url of moreover.com categories.")
563
564 (defun nnrss-snarf-moreover-categories ()
565   "Snarf RSS links from moreover.com."
566   (interactive)
567   (let (category name url changed)
568     (with-temp-buffer
569       (nnrss-insert nnrss-moreover-url)
570       (goto-char (point-min))
571       (while (re-search-forward
572               "<A NAME=\"\\([^\"]+\\)\">\\|<A HREF=\"\\(http://[^\"]*moreover\\.com[^\"]+page\\?c=\\([^\"&]+\\)&o=rss\\)" nil t)
573         (if (match-string 1)
574             (setq category (match-string 1))
575           (setq url (match-string 2)
576                 name (mm-url-decode-entities-string
577                       (rfc2231-decode-encoded-string
578                        (match-string 3))))
579           (if category
580               (setq name (concat category "." name)))
581           (unless (assoc name nnrss-server-data)
582             (setq changed t)
583             (push (list name 0 url) nnrss-server-data)))))
584     (if changed
585         (nnrss-save-server-data ""))))
586
587 (defun nnrss-format-string (string)
588   (gnus-replace-in-string (nnrss-string-as-multibyte string) " *\n *" " "))
589
590 (defun nnrss-node-text (node)
591   (if (and node (listp node))
592       (mapconcat 'nnrss-node-text (cddr node) "")
593     node))
594
595 (provide 'nnrss)
596
597 ;;; nnrss.el ends here