From: David Hansen <david.hansen@gmx.net>
Subject: nnrss.el patch to add support for the <comments> tag
Date: Tue, 04 Oct 2005 14:56:14 +0200 [thread overview]
Message-ID: <87br25widt.fsf@robotron.ath.cx> (raw)
[-- Attachment #1: Type: text/plain, Size: 133 bytes --]
Hello,
the small attached patch adds support for the <comments> tag as
used by e.g. http://thepiratebay.org/rss.php?cat=101
David
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnrss.diff --]
[-- Type: text/x-patch, Size: 2386 bytes --]
--- share/emacs/site-lisp/gnus/nnrss.el 2005-10-04 13:03:12.000000000 +0200
+++ cvs-src/gnus/lisp/nnrss.el 2005-10-04 14:44:19.000000000 +0200
@@ -197,6 +197,7 @@
" ")))
(link (nth 2 e))
(enclosure (nth 7 e))
+ (comments (nth 8 e))
;; Enable encoding of Newsgroups header in XEmacs.
(default-enable-multibyte-characters t)
(rfc2047-header-encoding-alist
@@ -205,7 +206,7 @@
rfc2047-header-encoding-alist)
rfc2047-header-encoding-alist))
rfc2047-encode-encoded-words body)
- (when (or text link enclosure)
+ (when (or text link enclosure comments)
(insert "\n")
(insert "<#multipart type=alternative>\n"
"<#part type=\"text/plain\">\n")
@@ -220,6 +221,8 @@
(insert (car enclosure) " "
(nth 2 enclosure) " "
(nth 3 enclosure) "\n"))
+ (when comments
+ (insert comments "\n"))
(setq body (buffer-substring body (point)))
(insert "<#/part>\n"
"<#part type=\"text/html\">\n"
@@ -232,6 +235,8 @@
(insert "<p><a href=\"" (car enclosure) "\">"
(cadr enclosure) "</a> " (nth 2 enclosure)
" " (nth 3 enclosure) "</p>\n"))
+ (when comments
+ (insert "<p><a href=\"" comments "\">comments</a></p>\n"))
(insert "</body></html>\n"
"<#/part>\n"
"<#/multipart>\n"))
@@ -529,7 +534,7 @@
(defun nnrss-check-group (group server)
(let (file xml subject url extra changed author date
- enclosure rss-ns rdf-ns content-ns dc-ns)
+ enclosure comments rss-ns rdf-ns content-ns dc-ns)
(if (and nnrss-use-local
(file-exists-p (setq file (expand-file-name
(nnrss-translate-file-chars
@@ -577,6 +582,7 @@
(setq date (or (nnrss-node-text dc-ns 'date item)
(nnrss-node-text rss-ns 'pubDate item)
(message-make-date)))
+ (setq comments (nnrss-node-text rss-ns 'comments item))
(when (setq enclosure (cadr (assq (intern (concat rss-ns "enclosure")) item)))
(let ((url (cdr (assq 'url enclosure)))
(len (cdr (assq 'length enclosure)))
@@ -607,7 +613,8 @@
(and author (nnrss-mime-encode-string author))
date
(and extra (nnrss-decode-entities-string extra))
- enclosure)
+ enclosure
+ comments)
nnrss-group-data)
(puthash (or url extra) t nnrss-group-hashtb)
(setq changed t))
next reply other threads:[~2005-10-04 12:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-04 12:56 David Hansen [this message]
2005-10-04 22:44 ` Katsumi Yamaoka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87br25widt.fsf@robotron.ath.cx \
--to=david.hansen@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).