Gnus development mailing list
 help / color / mirror / Atom feed
* nnrss.el patch to add support for the <comments> tag
@ 2005-10-04 12:56 David Hansen
  2005-10-04 22:44 ` Katsumi Yamaoka
  0 siblings, 1 reply; 2+ messages in thread
From: David Hansen @ 2005-10-04 12:56 UTC (permalink / 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))

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: nnrss.el patch to add support for the <comments> tag
  2005-10-04 12:56 nnrss.el patch to add support for the <comments> tag David Hansen
@ 2005-10-04 22:44 ` Katsumi Yamaoka
  0 siblings, 0 replies; 2+ messages in thread
From: Katsumi Yamaoka @ 2005-10-04 22:44 UTC (permalink / raw)


>>>>> In <87br25widt.fsf@robotron.ath.cx> David Hansen wrote:

> Hello,

> the small attached patch adds support for the <comments> tag as
> used by e.g. http://thepiratebay.org/rss.php?cat=101

> David

Thank you for the patch.  It looks very useful.  I've applied it
to the trunk and the v5-10 branch.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-10-04 22:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-04 12:56 nnrss.el patch to add support for the <comments> tag David Hansen
2005-10-04 22:44 ` Katsumi Yamaoka

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).