Gnus development mailing list
 help / color / mirror / Atom feed
* Using nnrss very actively
@ 2008-10-16 13:00 Lars Magne Ingebrigtsen
  2008-10-16 13:15 ` David Engster
                   ` (4 more replies)
  0 siblings, 5 replies; 34+ messages in thread
From: Lars Magne Ingebrigtsen @ 2008-10-16 13:00 UTC (permalink / raw)
  To: ding

I've grown tired of mousing around in Firefox to read RSS feeds, so I
thought I'd switch to nnrss.  I've added a few feeds, but hitting `g'
can get kinda slow when you've added 20 feeds.  So I'd put them on a
higher level, but then they don't really get updated until I say so,
which kinda sucks.

So how do all y'all use nnrss daily?

Unless I'm missing something, I think I'd like to write something that'd
either fetch the feeds in the background, or just run a separate Emacs
from cron to slurp in new feeds.  Or has anybody already written that? 

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Using nnrss very actively
  2008-10-16 13:00 Using nnrss very actively Lars Magne Ingebrigtsen
@ 2008-10-16 13:15 ` David Engster
  2008-10-16 13:27   ` Lars Magne Ingebrigtsen
  2008-10-16 13:17 ` Using nnrss very actively Robert D. Crawford
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 34+ messages in thread
From: David Engster @ 2008-10-16 13:15 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Unless I'm missing something, I think I'd like to write something that'd
> either fetch the feeds in the background, or just run a separate Emacs
> from cron to slurp in new feeds.  Or has anybody already written that? 

It's already there :-)

,----
| nnrss-generate-download-script is an interactive compiled Lisp function in `nnrss.el'.
| (nnrss-generate-download-script)
| 
| Generate a download script in the current buffer.
| It is useful when `(setq nnrss-use-local t)'.
`----

This generates a skript which you can call from cron. Then set
nnrss-use-local to t.

-David





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

* Re: Using nnrss very actively
  2008-10-16 13:00 Using nnrss very actively Lars Magne Ingebrigtsen
  2008-10-16 13:15 ` David Engster
@ 2008-10-16 13:17 ` Robert D. Crawford
  2008-10-16 13:18 ` Adam Sjøgren
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 34+ messages in thread
From: Robert D. Crawford @ 2008-10-16 13:17 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> So how do all y'all use nnrss daily?
>
> Unless I'm missing something, I think I'd like to write something that'd
> either fetch the feeds in the background, or just run a separate Emacs
> from cron to slurp in new feeds.  Or has anybody already written that? 

Try this:

,----
| `nnrss-use-local'
|      If you set `nnrss-use-local' to `t', `nnrss' will read the feeds
|      from local files in `nnrss-directory'.  You can use the command
|      `nnrss-generate-download-script' to generate a download script
|      using `wget'.
`----

-- 
Robert D. Crawford                                      rdc1x@comcast.net

A journey of a thousand miles starts under one's feet.
		-- Lao Tsu




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

* Re: Using nnrss very actively
  2008-10-16 13:00 Using nnrss very actively Lars Magne Ingebrigtsen
  2008-10-16 13:15 ` David Engster
  2008-10-16 13:17 ` Using nnrss very actively Robert D. Crawford
@ 2008-10-16 13:18 ` Adam Sjøgren
  2008-10-18 23:10 ` Sebastian Krause
  2008-10-18 23:16 ` Kevin Ryde
  4 siblings, 0 replies; 34+ messages in thread
From: Adam Sjøgren @ 2008-10-16 13:18 UTC (permalink / raw)
  To: ding

On Thu, 16 Oct 2008 15:00:26 +0200, Lars wrote:

> I've grown tired of mousing around in Firefox to read RSS feeds, so I
> thought I'd switch to nnrss.  I've added a few feeds, but hitting `g'
> can get kinda slow when you've added 20 feeds.  So I'd put them on a
> higher level, but then they don't really get updated until I say so,
> which kinda sucks.

> So how do all y'all use nnrss daily?

I use a script that fetches the feeds once an hour (by cron), and Gnus
just reads the fetched files.

I think it is described in the documentation, and there is a function to
create the script?

,----[ RSS ]
| `nnrss-use-local'
|      If you set `nnrss-use-local' to `t', `nnrss' will read the feeds
|      from local files in `nnrss-directory'.  You can use the command
|      `nnrss-generate-download-script' to generate a download script
|      using `wget'.
`----

The next thing is then that parsing the fetched files still seems slow
to me, but I guess that is an elisp-optimization task.


  Best regards,

    Adam

-- 
 "I always liked songs with parentheses in the title."        Adam Sjøgren
                                                         asjo@koldfront.dk




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

* Re: Using nnrss very actively
  2008-10-16 13:15 ` David Engster
@ 2008-10-16 13:27   ` Lars Magne Ingebrigtsen
  2008-10-16 13:43     ` David Engster
  0 siblings, 1 reply; 34+ messages in thread
From: Lars Magne Ingebrigtsen @ 2008-10-16 13:27 UTC (permalink / raw)
  To: ding

David Engster <deng@randomsample.de> writes:

> This generates a skript which you can call from cron. Then set
> nnrss-use-local to t.

Ah, nice...

Then the RSS files are parsed when you hit `g', I guess?  Is that fast
enough to not be annoying?

And a related question: What HTML renderer do y'all use?  I'm currently
using w3m, but that doesn't support purdy pictures (unless I'm missing
something).  

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Using nnrss very actively
  2008-10-16 13:27   ` Lars Magne Ingebrigtsen
@ 2008-10-16 13:43     ` David Engster
  2008-10-16 13:52       ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 34+ messages in thread
From: David Engster @ 2008-10-16 13:43 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Then the RSS files are parsed when you hit `g', I guess?  Is that fast
> enough to not be annoying?

That depends on the size of the feed and how many you have (of
course). I find it fast enough, but I only have about 5 RSS feeds (I use
nnshimbun from emacs-w3m wherever possible).

> And a related question: What HTML renderer do y'all use?  I'm currently
> using w3m, but that doesn't support purdy pictures (unless I'm missing
> something).  

emacs-w3m does support images. I use

 (mm-inline-text-html-with-images t)
 (mm-discouraged-alternatives nil)
 (mm-w3m-safe-url-regexp nil)

in my RSS topic parameters (I don't know anymore if the latter two are
really necessary).

-David



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

* Re: Using nnrss very actively
  2008-10-16 13:43     ` David Engster
@ 2008-10-16 13:52       ` Lars Magne Ingebrigtsen
  2008-10-16 16:27         ` Mark Plaksin
  0 siblings, 1 reply; 34+ messages in thread
From: Lars Magne Ingebrigtsen @ 2008-10-16 13:52 UTC (permalink / raw)
  To: ding

David Engster <deng@randomsample.de> writes:

> emacs-w3m does support images. I use
>
>  (mm-inline-text-html-with-images t)
>  (mm-discouraged-alternatives nil)
>  (mm-w3m-safe-url-regexp nil)

Great!  That does the trick for me, too.

Geeze.  Now I don't even have to program anything.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Using nnrss very actively
  2008-10-16 13:52       ` Lars Magne Ingebrigtsen
@ 2008-10-16 16:27         ` Mark Plaksin
  2008-10-16 17:15           ` Lars Magne Ingebrigtsen
  2008-10-16 17:46           ` Robert D. Crawford
  0 siblings, 2 replies; 34+ messages in thread
From: Mark Plaksin @ 2008-10-16 16:27 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> David Engster <deng@randomsample.de> writes:
>
>> emacs-w3m does support images. I use
>>
>>  (mm-inline-text-html-with-images t)
>>  (mm-discouraged-alternatives nil)
>>  (mm-w3m-safe-url-regexp nil)
>
> Great!  That does the trick for me, too.
>
> Geeze.  Now I don't even have to program anything.  :-)

But wait!  You *do* want to program something.  nnrss doesn't deal with
ATOM feeds so what you really want to do is write nngreader :)  g-client
from Emacspeak has some of the work done already.  I started working on
nngreader for myself a while back haven't had time to touch it lately.




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

* Re: Using nnrss very actively
  2008-10-16 16:27         ` Mark Plaksin
@ 2008-10-16 17:15           ` Lars Magne Ingebrigtsen
  2008-10-17  8:45             ` Paul R
  2008-10-17 14:00             ` Andreas Seltenreich
  2008-10-16 17:46           ` Robert D. Crawford
  1 sibling, 2 replies; 34+ messages in thread
From: Lars Magne Ingebrigtsen @ 2008-10-16 17:15 UTC (permalink / raw)
  To: ding

Mark Plaksin <happy@mcplaksin.org> writes:

> But wait!  You *do* want to program something.  nnrss doesn't deal with
> ATOM feeds so what you really want to do is write nngreader :) 

Cool!  :-)

But can't Atom support just be folded into nnrss?  The difference
between Atom and RSS is kinda...  not extremely big, if I recall
correctly. 

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Using nnrss very actively
  2008-10-16 16:27         ` Mark Plaksin
  2008-10-16 17:15           ` Lars Magne Ingebrigtsen
@ 2008-10-16 17:46           ` Robert D. Crawford
  2008-10-16 19:27             ` David Engster
  1 sibling, 1 reply; 34+ messages in thread
From: Robert D. Crawford @ 2008-10-16 17:46 UTC (permalink / raw)
  To: ding

Mark Plaksin <happy@mcplaksin.org> writes:

> But wait!  You *do* want to program something.  nnrss doesn't deal
> with ATOM feeds so what you really want to do is write nngreader :)
> g-client from Emacspeak has some of the work done already.  I started
> working on nngreader for myself a while back haven't had time to touch
> it lately.

One solution is to try this:

$WGET -q -O "$RSSDIR"/'Planet Emacsen.xml' 'http://planet.emacsen.org/atom.xml' 
cd /home/rdc/News/rss
mv Planet\ Emacsen.xml Planet\ Emacsen.temp.xml 
xsltproc -o Planet\ Emacsen.xml /home/rdc/share/emacs/site-lisp/emacspeak/xsl/atom2rss.xsl Planet\ Emacsen.temp.xml

works, and that is really all that matters until gnus supports atom.  

rdc
-- 
Robert D. Crawford                                      rdc1x@comcast.net





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

* Re: Using nnrss very actively
  2008-10-16 17:46           ` Robert D. Crawford
@ 2008-10-16 19:27             ` David Engster
  2008-10-20 17:13               ` Mark Plaksin
  0 siblings, 1 reply; 34+ messages in thread
From: David Engster @ 2008-10-16 19:27 UTC (permalink / raw)
  To: ding

"Robert D. Crawford" <rdc1x@comcast.net> writes:
> Mark Plaksin <happy@mcplaksin.org> writes:
>
>> But wait!  You *do* want to program something.  nnrss doesn't deal
>> with ATOM feeds so what you really want to do is write nngreader :)
>> g-client from Emacspeak has some of the work done already.  I started
>> working on nngreader for myself a while back haven't had time to touch
>> it lately.
>
> One solution is to try this:
>
> $WGET -q -O "$RSSDIR"/'Planet Emacsen.xml' 'http://planet.emacsen.org/atom.xml' 
> cd /home/rdc/News/rss
> mv Planet\ Emacsen.xml Planet\ Emacsen.temp.xml 
> xsltproc -o Planet\ Emacsen.xml /home/rdc/share/emacs/site-lisp/emacspeak/xsl/atom2rss.xsl Planet\ Emacsen.temp.xml
>
> works, and that is really all that matters until gnus supports atom.  

For people who don't use these wget scripts, one can also defadvice
mm-url-insert to call xsltproc:

http://www.randomsample.de/dru5/node/8

-David



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

* Re: Using nnrss very actively
  2008-10-16 17:15           ` Lars Magne Ingebrigtsen
@ 2008-10-17  8:45             ` Paul R
  2008-10-17  8:57               ` David Engster
  2008-10-17 14:00             ` Andreas Seltenreich
  1 sibling, 1 reply; 34+ messages in thread
From: Paul R @ 2008-10-17  8:45 UTC (permalink / raw)
  To: ding


Lars> Cool! :-)

Lars> But can't Atom support just be folded into nnrss? The difference
Lars> between Atom and RSS is kinda... not extremely big, if I recall
Lars> correctly.

The lack of support of ATOM is what drove me out of using gnus for rss
feeds, and having to use a dedicated software for reading feeds has
been painful since. I contacted nnrss original author, Shenghuo Zhu,
to ask hoom whether he planed to add Atom support. But he does not, he
now has other plans in other projects so he won't do it.
I found myself unable to fit a transparent Atom support in nnrss.el in
the time I could spend to try, but :
 - I'm a fairly low skilled emacs lisp user ;
 - I could not afford more than 3 hours to this project.

Like Lars, I believe that the difference between RSS2.0 and Atom is
very low, and I think most of us don't mind not having very specific
support of either format. We just want to be able to browse the news
hitting space bar, because any other key is way too small to be hit
reliably with the left hand (yes, right hand holds a pterodactyl mug,
and that's a full time job).

Any taker ?

-- 
  Paul



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

* Re: Using nnrss very actively
  2008-10-17  8:45             ` Paul R
@ 2008-10-17  8:57               ` David Engster
  2008-10-17  9:18                 ` Paul R
  0 siblings, 1 reply; 34+ messages in thread
From: David Engster @ 2008-10-17  8:57 UTC (permalink / raw)
  To: ding

Paul R <paul.r.ml@gmail.com> writes:
> Like Lars, I believe that the difference between RSS2.0 and Atom is
> very low, and I think most of us don't mind not having very specific
> support of either format. We just want to be able to browse the news
> hitting space bar, because any other key is way too small to be hit
> reliably with the left hand (yes, right hand holds a pterodactyl mug,
> and that's a full time job).
>
> Any taker ?

I was looking into this, but then found a solution using xsltproc, which
works perfectly for me and thus I didn't saw any need to proceed
further.

I already linked to it, but here's the setup in a nutshell:

* apt-get install xsltproc
* cd $HOME ; wget http://atom.geekhood.net/atom2rss.xsl

Put the following into your .emacs:

(require 'mm-url)
(defadvice mm-url-insert (after DE-convert-atom-to-rss () )
  "Converts atom to RSS by calling xsltproc."
  (when (re-search-forward "xmlns=\"http://www.w3.org/.*/Atom\"" 
               nil t)
    (message "Converting Atom to RSS... ")
    (goto-char (point-min))
    (call-process-region (point-min) (point-max) 
             "xsltproc" 
             t t nil 
             (expand-file-name "~/atom2rss.xsl") "-")
    (goto-char (point-min))
    (message "Converting Atom to RSS... done")))

(ad-activate 'mm-url-insert)

-David



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

* Re: Using nnrss very actively
  2008-10-17  8:57               ` David Engster
@ 2008-10-17  9:18                 ` Paul R
  0 siblings, 0 replies; 34+ messages in thread
From: Paul R @ 2008-10-17  9:18 UTC (permalink / raw)
  To: ding

Hi david,

David> I was looking into this, but then found a solution using
David> xsltproc, which works perfectly for me and thus I didn't saw
David> any need to proceed further.

That's pretty smart indeed, but a built-in solution would be more
comfortable to set up and to use, hence it would be preferable. But in
the meantime, I might try your setup, thanks.

-- 
  Paul



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

* Re: Using nnrss very actively
  2008-10-16 17:15           ` Lars Magne Ingebrigtsen
  2008-10-17  8:45             ` Paul R
@ 2008-10-17 14:00             ` Andreas Seltenreich
  1 sibling, 0 replies; 34+ messages in thread
From: Andreas Seltenreich @ 2008-10-17 14:00 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen writes:

> But can't Atom support just be folded into nnrss?  The difference
> between Atom and RSS is kinda...  not extremely big, if I recall
> correctly. 

I tried the folding approach about a year ago but didn't like the
result[1]. The difference is, IIRC, that Atom allows for more
sophisticated content structure, and for nnrss to support it properly,
it would have to create articles with arbitrary MIME layout instead of
just the plain text/html multipart/alternative articles. So, while the
attached patch worked tolerable with all atom feeds I threw at it, it
isn't a proper solution, which would require a more invasive rewrite.

regards,
andreas

Footnotes: 
[1]  

Index: nnrss.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnrss.el,v
retrieving revision 7.59
diff -c -r7.59 nnrss.el
*** nnrss.el	11 Jun 2008 14:19:44 -0000	7.59
--- nnrss.el	17 Oct 2008 13:21:49 -0000
***************
*** 696,704 ****
         nnrss-file-coding-system))
  
  (defun nnrss-check-group (group server)
!   (let (file xml subject url extra changed author date feed-subject
! 	     enclosure comments rss-ns rdf-ns content-ns dc-ns
! 	     hash-index)
      (if (and nnrss-use-local
  	     (file-exists-p (setq file (expand-file-name
  					(nnrss-translate-file-chars
--- 696,702 ----
         nnrss-file-coding-system))
  
  (defun nnrss-check-group (group server)
!   (let (file xml url changed)
      (if (and nnrss-use-local
  	     (file-exists-p (setq file (expand-file-name
  					(nnrss-translate-file-chars
***************
*** 720,732 ****
  	    (push (list group nnrss-group-max url) nnrss-server-data)))
  	(setq changed t))
        (setq xml (nnrss-fetch url)))
!     ;; See
!     ;; http://feeds.archive.org/validator/docs/howto/declare_namespaces.html
!     ;; for more RSS namespaces.
!     (setq dc-ns (nnrss-get-namespace-prefix xml "http://purl.org/dc/elements/1.1/")
! 	  rdf-ns (nnrss-get-namespace-prefix xml "http://www.w3.org/1999/02/22-rdf-syntax-ns#")
! 	  rss-ns (nnrss-get-namespace-prefix xml "http://purl.org/rss/1.0/")
! 	  content-ns (nnrss-get-namespace-prefix xml "http://purl.org/rss/1.0/modules/content/"))
      (dolist (item (nreverse (nnrss-find-el (intern (concat rss-ns "item")) xml)))
        (when (and (listp item)
  		 (string= (concat rss-ns "item") (car item))
--- 718,747 ----
  	    (push (list group nnrss-group-max url) nnrss-server-data)))
  	(setq changed t))
        (setq xml (nnrss-fetch url)))
!     (let ((changed nnrss-group-data))
!       (cond ((nnrss-rss-p xml) (nnrss-check-group-rss xml))
! 	    ((nnrss-atom-p xml) (nnrss-check-group-atom xml)))
!       (unless (eq changed nnrss-group-data)
! 	(nnrss-save-group-data group server)
! 	(let ((pair (assoc group nnrss-server-data)))
! 	  (if pair
! 	      (setcar (cdr pair) nnrss-group-max)
! 	    (push (list group nnrss-group-max) nnrss-server-data)))
! 	(nnrss-save-server-data server)))))
! 
! (defun nnrss-check-group-rss (xml)
!   ;; See
!   ;; http://feeds.archive.org/validator/docs/howto/declare_namespaces.html
!   ;; for more RSS namespaces.
!   (let ((dc-ns (nnrss-get-namespace-prefix xml "http://purl.org/dc/elements/1.1/"))
! 	(rdf-ns (nnrss-get-namespace-prefix xml "http://www.w3.org/1999/02/22-rdf-syntax-ns#"))
! 	(rss-ns (nnrss-get-namespace-prefix xml "http://purl.org/rss/1.0/"))
! 	(content-ns (nnrss-get-namespace-prefix xml
! 						"http://purl.org/rss/1.0/modules/content/"))
! 
! 	subject url extra author date feed-subject
! 	enclosure comments rss-ns rdf-ns content-ns dc-ns
! 	hash-index)
      (dolist (item (nreverse (nnrss-find-el (intern (concat rss-ns "item")) xml)))
        (when (and (listp item)
  		 (string= (concat rss-ns "item") (car item))
***************
*** 780,795 ****
  	  comments
  	  hash-index)
  	 nnrss-group-data)
! 	(puthash hash-index t nnrss-group-hashtb)
! 	(setq changed t))
        (setq extra nil))
!     (when changed
!       (nnrss-save-group-data group server)
!       (let ((pair (assoc group nnrss-server-data)))
! 	(if pair
! 	    (setcar (cdr pair) nnrss-group-max)
! 	  (push (list group nnrss-group-max) nnrss-server-data)))
!       (nnrss-save-server-data server))))
  
  (declare-function gnus-group-make-rss-group "gnus-group" (&optional url))
  
--- 795,872 ----
  	  comments
  	  hash-index)
  	 nnrss-group-data)
! 	(puthash hash-index t nnrss-group-hashtb))
        (setq extra nil))
!     ))
! 
! (defun nnrss-check-group-atom (xml)
!   (let ((atom-ns (nnrss-get-namespace-prefix
! 		  xml "http://www.w3.org/2005/Atom"))
! 	(xhtml-ns (nnrss-get-namespace-prefix
! 		   xml "http://www.w3.org/1999/xhtml"))
! 	hash-index)
!     (dolist (entry (nreverse (xml-get-children
! 			      (assoc 'feed xml)
! 			      (intern (concat atom-ns "entry")))))
!       (when (and (string= (concat atom-ns "entry") (car-safe entry))
! 		 (progn (setq hash-index
! 			      (md5 (nnrss-node-text atom-ns 'id entry)))
! 			(not (gethash hash-index nnrss-group-hashtb))))
! 	(let ((title (nnrss-node-text atom-ns 'title entry))
! 	      (content
! 	       (let* ((el (car (or
! 				(xml-get-children
! 				 entry
! 				 (intern (concat atom-ns "content")))
! 				(xml-get-children
! 				 entry
! 				 (intern (concat atom-ns "summary"))))))
! 		      (ctype (xml-get-attribute-or-nil el 'type)))
! 		 (if (string= ctype "xhtml")
! 		     (with-temp-buffer
! 		       (xml-debug-print (list (caddr (cdr el))))
! 		       (buffer-string))
! 		   (nnrss-decode-entities-string
! 		    (nnrss-node-just-text el)))))
! 	      (url
! 	       (cdr (assoc 'href (cadr (assoc (intern (concat atom-ns "link"))
! 					      entry)))))
! 	      (from (mapconcat (lambda (author)
! 				 (nnrss-atom-parse-author atom-ns author))
! 			       (or (xml-get-children
! 				    entry
! 				    (intern (concat atom-ns "author")))
! 				   (xml-get-children
! 				    (assoc 'feed xml)
! 				    (intern (concat atom-ns "author"))))
! 			       ", "))
! 	      (date (nnrss-normalize-date
! 		     (nnrss-node-text atom-ns 'updated entry))))
! 	  (push
! 	   (list
! 	    (incf nnrss-group-max)
! 	    (current-time)
! 	    url
! 	    (and title (nnrss-mime-encode-string title))
! 	    (and from (nnrss-mime-encode-string from))
! 	    date
! 	    content
! 	    nil
! 	    nil
! 	    hash-index)
! 	   nnrss-group-data)
! 	  (puthash hash-index t nnrss-group-hashtb))))))
! 
! (defun nnrss-atom-parse-author (atom-ns el)
!   "Format an Atom author element EL into a proper rfc822 `From' header."
!   (let ((name (nnrss-node-text atom-ns 'name el))
! 	(email (nnrss-node-text atom-ns 'email el)))
!     ;; FIXME: Add proper quoting
!     (if name
! 	(format "\"%s\" <%s>"
! 		name
! 		(or email "nil@nil.invalid"))
!       email)))
  
  (declare-function gnus-group-make-rss-group "gnus-group" (&optional url))
  
***************
*** 1014,1054 ****
  
    (let ((parsed-page (nnrss-fetch url)))
  
! ;;    1. if this url is the rss, use it.
!     (if (nnrss-rss-p parsed-page)
! 	(let ((rss-ns (nnrss-get-namespace-prefix parsed-page "http://purl.org/rss/1.0/")))
! 	  (nnrss-rss-title-description rss-ns parsed-page url))
! 
  ;;    2. look for the <link rel="alternate"
  ;;    type="application/rss+xml" and use that if it is there.
!       (let ((links (nnrss-get-rsslinks parsed-page)))
! 	(if links
! 	    (let* ((xml (nnrss-fetch
! 			 (cdr (assoc 'href (cadar links)))))
! 		   (rss-ns (nnrss-get-namespace-prefix xml "http://purl.org/rss/1.0/")))
! 	      (nnrss-rss-title-description rss-ns xml (cdr (assoc 'href (cadar links)))))
  
  ;;    3. look for links on the site in the following order:
  ;;       - onsite links ending in .rss, .rdf, or .xml
  ;;       - onsite links containing any of the above
  ;;       - offsite links ending in .rss, .rdf, or .xml
  ;;       - offsite links containing any of the above
! 	  (let* ((base-uri (progn (string-match ".*://[^/]+/?" url)
! 				  (match-string 0 url)))
! 		 (hrefs (nnrss-order-hrefs
! 			 base-uri (nnrss-extract-hrefs parsed-page)))
! 		 (rss-link nil))
! 	    (while (and (eq rss-link nil) (not (eq hrefs nil)))
! 	      (let ((href-data (nnrss-fetch (car hrefs))))
! 		(if (nnrss-rss-p href-data)
! 		    (let* ((rss-ns (nnrss-get-namespace-prefix href-data "http://purl.org/rss/1.0/")))
! 		      (setq rss-link (nnrss-rss-title-description
! 				      rss-ns href-data (car hrefs))))
! 		  (setq hrefs (cdr hrefs)))))
! 	    (if rss-link rss-link
  
  ;;    4. check syndic8
! 	      (nnrss-find-rss-via-syndic8 url))))))))
  
  (defun nnrss-find-rss-via-syndic8 (url)
    "Query syndic8 for the rss feeds it has for URL."
--- 1091,1134 ----
  
    (let ((parsed-page (nnrss-fetch url)))
  
! ;;    1. if this url is the feed, use it.
!     (cond ((nnrss-rss-p parsed-page)
! 	   (let ((rss-ns (nnrss-get-namespace-prefix parsed-page "http://purl.org/rss/1.0/")))
! 	     (nnrss-rss-title-description rss-ns parsed-page url)))
! 	  ((nnrss-atom-p parsed-page)
! 	   (let ((rss-ns (nnrss-get-namespace-prefix parsed-page "http://www.w3.org/2005/Atom")))
! 	     (nnrss-atom-title-description rss-ns parsed-page url)))
! 	  (t
  ;;    2. look for the <link rel="alternate"
  ;;    type="application/rss+xml" and use that if it is there.
! 	   (let ((links (nnrss-get-rsslinks parsed-page)))
! 	     (if links
! 		 (let* ((xml (nnrss-fetch
! 			      (cdr (assoc 'href (cadar links)))))
! 			(rss-ns (nnrss-get-namespace-prefix xml "http://purl.org/rss/1.0/")))
! 		   (nnrss-rss-title-description rss-ns xml (cdr (assoc 'href (cadar links)))))
  
  ;;    3. look for links on the site in the following order:
  ;;       - onsite links ending in .rss, .rdf, or .xml
  ;;       - onsite links containing any of the above
  ;;       - offsite links ending in .rss, .rdf, or .xml
  ;;       - offsite links containing any of the above
! 	       (let* ((base-uri (progn (string-match ".*://[^/]+/?" url)
! 				       (match-string 0 url)))
! 		      (hrefs (nnrss-order-hrefs
! 			      base-uri (nnrss-extract-hrefs parsed-page)))
! 		      (rss-link nil))
! 		 (while (and (eq rss-link nil) (not (eq hrefs nil)))
! 		   (let ((href-data (nnrss-fetch (car hrefs))))
! 		     (if (nnrss-rss-p href-data)
! 			 (let* ((rss-ns (nnrss-get-namespace-prefix href-data "http://purl.org/rss/1.0/")))
! 			   (setq rss-link (nnrss-rss-title-description
! 					   rss-ns href-data (car hrefs))))
! 		       (setq hrefs (cdr hrefs)))))
! 		 (if rss-link rss-link
  
  ;;    4. check syndic8
! 		   (nnrss-find-rss-via-syndic8 url)))))))))
  
  (defun nnrss-find-rss-via-syndic8 (url)
    "Query syndic8 for the rss feeds it has for URL."
***************
*** 1103,1108 ****
--- 1183,1192 ----
    (or (eq (caar data) 'rss)
        (eq (caar data) 'rdf:RDF)))
  
+ (defun nnrss-atom-p (data)
+   "Test if DATA is an Atom feed."
+   (eq (caar data) 'feed))
+ 
  (defun nnrss-rss-title-description (rss-namespace data url)
    "Return the title of an RSS feed."
    (if (nnrss-rss-p data)
***************
*** 1115,1120 ****
--- 1199,1215 ----
  	 (cons 'title (caddr (nth 0 (nnrss-find-el title channel))))
  	 (cons 'href url)))))
  
+ (defun nnrss-atom-title-description (atom-ns data url)
+   "Return the title of an Atom feed."
+   (let ((title (intern (concat atom-ns "title")))
+ 	(link (intern (concat atom-ns "link")))
+ 	(subtitle (intern (concat atom-ns "subtitle")))
+ 	(feed (cddr (assoc 'feed data))))
+     (list
+      (cons 'title (caddr (assoc title feed)))
+      (cons 'description (caddr (assoc subtitle feed)))
+      (cons 'href url))))
+ 
  (defun nnrss-get-namespace-prefix (el uri)
    "Given EL (containing a parsed element) and URI (containing a string
  that gives the URI for which you want to retrieve the namespace



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

* Re: Using nnrss very actively
  2008-10-16 13:00 Using nnrss very actively Lars Magne Ingebrigtsen
                   ` (2 preceding siblings ...)
  2008-10-16 13:18 ` Adam Sjøgren
@ 2008-10-18 23:10 ` Sebastian Krause
  2008-10-18 23:16 ` Kevin Ryde
  4 siblings, 0 replies; 34+ messages in thread
From: Sebastian Krause @ 2008-10-18 23:10 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:
> I've grown tired of mousing around in Firefox to read RSS feeds, so I
> thought I'd switch to nnrss.  I've added a few feeds, but hitting `g'
> can get kinda slow when you've added 20 feeds.  So I'd put them on a
> higher level, but then they don't really get updated until I say so,
> which kinda sucks.

Even though I personally just use Google Reader (which can be used
with the keyboard quite fine), you might take a look at
http://pipes.yahoo.com/ and use it to combine several feeds into
one, making nnrss parse much fewer URLs. I guess Yahoo Pipes also
has RSS 2.0 as standard output even when the input is Atom (the
problem you have in anther post), so you could use it to convert the
feeds for you.




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

* Re: Using nnrss very actively
  2008-10-16 13:00 Using nnrss very actively Lars Magne Ingebrigtsen
                   ` (3 preceding siblings ...)
  2008-10-18 23:10 ` Sebastian Krause
@ 2008-10-18 23:16 ` Kevin Ryde
  2008-10-20 20:20   ` Lars Magne Ingebrigtsen
  4 siblings, 1 reply; 34+ messages in thread
From: Kevin Ryde @ 2008-10-18 23:16 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>
> Unless I'm missing something, I think I'd like to write something that'd
> either fetch the feeds in the background, or just run a separate Emacs
> from cron to slurp in new feeds.  Or has anybody already written that? 

There's a few external programs for downloading.  rss2email, feed2imap,
toursst (to maildir, but maybe defunct), or Plagger (read and write
various forms).

I ended up (gratuitous plug :-) making my own rss2leafnode (writing to
rnews so perhaps working with inn or cnews too), with combinations of
link fetching and html to text rendering I wanted.



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

* Re: Using nnrss very actively
  2008-10-16 19:27             ` David Engster
@ 2008-10-20 17:13               ` Mark Plaksin
  2008-10-21 15:53                 ` Ted Zlatanov
                                   ` (2 more replies)
  0 siblings, 3 replies; 34+ messages in thread
From: Mark Plaksin @ 2008-10-20 17:13 UTC (permalink / raw)
  To: ding

David Engster <deng@randomsample.de> writes:

> "Robert D. Crawford" <rdc1x@comcast.net> writes:
>
>> Mark Plaksin <happy@mcplaksin.org> writes:
>>
>>> But wait!  You *do* want to program something.  nnrss doesn't deal
>>> with ATOM feeds so what you really want to do is write nngreader :)
>>> g-client from Emacspeak has some of the work done already.  I started
>>> working on nngreader for myself a while back haven't had time to touch
>>> it lately.
>>
>> One solution is to try this:
>>
>> $WGET -q -O "$RSSDIR"/'Planet Emacsen.xml' 'http://planet.emacsen.org/atom.xml' 
>> cd /home/rdc/News/rss
>> mv Planet\ Emacsen.xml Planet\ Emacsen.temp.xml 
>> xsltproc -o Planet\ Emacsen.xml /home/rdc/share/emacs/site-lisp/emacspeak/xsl/atom2rss.xsl Planet\ Emacsen.temp.xml
>>
>> works, and that is really all that matters until gnus supports atom.  
>
> For people who don't use these wget scripts, one can also defadvice
> mm-url-insert to call xsltproc:
>
> http://www.randomsample.de/dru5/node/8

These methods look cool and I'll try them.

Another problem that I have on and off with nnrss is having it show me
old articles.  I have this problem both when I use an external script to
fetch the feeds and when I don't.  I've tried to figure it out and there
have been threads on this list about it but I've never found a perfect
solution.

Do others have this problem too?  I haven't updated my CVS Emacs or Gnus
in a few months so maybe the problem is gone now.




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

* Re: Using nnrss very actively
  2008-10-18 23:16 ` Kevin Ryde
@ 2008-10-20 20:20   ` Lars Magne Ingebrigtsen
  2008-10-21 15:56     ` Ted Zlatanov
  2008-10-25  0:03     ` Kevin Ryde
  0 siblings, 2 replies; 34+ messages in thread
From: Lars Magne Ingebrigtsen @ 2008-10-20 20:20 UTC (permalink / raw)
  To: ding

Kevin Ryde <user42@zip.com.au> writes:

> I ended up (gratuitous plug :-) making my own rss2leafnode (writing to
> rnews so perhaps working with inn or cnews too), with combinations of
> link fetching and html to text rendering I wanted.

Hm...  interesting.

I've been using nnrss for a couple of days now for reading feeds, and it
seems to be working OK.  With Atom support and perhaps pre-loading of
inline images, it'd be even better.  That is, if it were to create a
multipart/related message and stash it on the disk somewhere, it'd be
even more pleasant to use.  (And it should support Atom, of course.)

I may take a whack at writing something in Gnus to do this, but
unfortunately the next couple of weeks are going to be really busy, so I
think I won't get around to it immediately. 

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Using nnrss very actively
  2008-10-20 17:13               ` Mark Plaksin
@ 2008-10-21 15:53                 ` Ted Zlatanov
  2008-10-21 16:24                 ` Adam Sjøgren
  2008-10-28  0:04                 ` Mark Plaksin
  2 siblings, 0 replies; 34+ messages in thread
From: Ted Zlatanov @ 2008-10-21 15:53 UTC (permalink / raw)
  To: ding

On Mon, 20 Oct 2008 13:13:58 -0400 Mark Plaksin <happy@usg.edu> wrote: 

MP> Another problem that I have on and off with nnrss is having it show me
MP> old articles.  I have this problem both when I use an external script to
MP> fetch the feeds and when I don't.  I've tried to figure it out and there
MP> have been threads on this list about it but I've never found a perfect
MP> solution.

MP> Do others have this problem too?  I haven't updated my CVS Emacs or Gnus
MP> in a few months so maybe the problem is gone now.

I use the latest Emacs and Gnus and many feeds (e.g. Slashdot and Reddit
Programming) show duplicates every time they get updated.  I don't know
the root reason due to lack of time, but it's definitely happening.

Ted




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

* Re: Using nnrss very actively
  2008-10-20 20:20   ` Lars Magne Ingebrigtsen
@ 2008-10-21 15:56     ` Ted Zlatanov
  2008-10-25  0:03     ` Kevin Ryde
  1 sibling, 0 replies; 34+ messages in thread
From: Ted Zlatanov @ 2008-10-21 15:56 UTC (permalink / raw)
  To: ding

On Mon, 20 Oct 2008 22:20:03 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 

LMI> I've been using nnrss for a couple of days now for reading feeds, and it
LMI> seems to be working OK.  With Atom support and perhaps pre-loading of
LMI> inline images, it'd be even better.  That is, if it were to create a
LMI> multipart/related message and stash it on the disk somewhere, it'd be
LMI> even more pleasant to use.  (And it should support Atom, of course.)

LMI> I may take a whack at writing something in Gnus to do this, but
LMI> unfortunately the next couple of weeks are going to be really busy, so I
LMI> think I won't get around to it immediately. 

There's lots of RSS-related ELisp code in newsticker, which is part of
Emacs now, and does Atom AFAICT.  Maybe some code can be reused to get
Atom support and to fix the duplicate problems that Mark Plaskin
mentioned.

Ted




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

* Re: Using nnrss very actively
  2008-10-20 17:13               ` Mark Plaksin
  2008-10-21 15:53                 ` Ted Zlatanov
@ 2008-10-21 16:24                 ` Adam Sjøgren
  2008-10-28  0:04                 ` Mark Plaksin
  2 siblings, 0 replies; 34+ messages in thread
From: Adam Sjøgren @ 2008-10-21 16:24 UTC (permalink / raw)
  To: ding

On Mon, 20 Oct 2008 13:13:58 -0400, Mark wrote:

> Another problem that I have on and off with nnrss is having it show me
> old articles.

This happens to me as well, and it pretty much has since... forever.


  Best regards,

-- 
 "I gotta go right now; someone is videotaping me in          Adam Sjøgren
  my spaceship"                                          asjo@koldfront.dk




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

* Re: Using nnrss very actively
  2008-10-20 20:20   ` Lars Magne Ingebrigtsen
  2008-10-21 15:56     ` Ted Zlatanov
@ 2008-10-25  0:03     ` Kevin Ryde
  2008-11-03 23:43       ` Content-Location for w3m display (was: Using nnrss very actively) Kevin Ryde
  1 sibling, 1 reply; 34+ messages in thread
From: Kevin Ryde @ 2008-10-25  0:03 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>
> multipart/related

Plagger does a little of that, rewriting downloaded html to turn image
links into "cid:".  Maybe the same for any css inclusions too.  The
other programs perhaps don't do that, as far as I can tell (including
mine, since I was only interested in text).  When not downloading maybe
Content-Location is enough to get images from the right places when
reading the message, or maybe plagger instead rewrites relative urls to
absolute ... I couldn't quite tell.



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

* Re: Using nnrss very actively
  2008-10-20 17:13               ` Mark Plaksin
  2008-10-21 15:53                 ` Ted Zlatanov
  2008-10-21 16:24                 ` Adam Sjøgren
@ 2008-10-28  0:04                 ` Mark Plaksin
  2008-10-28  5:20                   ` Andreas Seltenreich
  2 siblings, 1 reply; 34+ messages in thread
From: Mark Plaksin @ 2008-10-28  0:04 UTC (permalink / raw)
  To: ding

Mark Plaksin <happy@usg.edu> writes:

> Another problem that I have on and off with nnrss is having it show me
> old articles.  I have this problem both when I use an external script to
> fetch the feeds and when I don't.  I've tried to figure it out and there
> have been threads on this list about it but I've never found a perfect
> solution.
>
> Do others have this problem too?  I haven't updated my CVS Emacs or Gnus
> in a few months so maybe the problem is gone now.

One last note about this.  Neither the internal nor external fetch
methods of nnrss do the right thing with Etags or If-modified-since.
That is, the stuff discussed here:
http://fishbowl.pastiche.org/2002/10/21/http_conditional_get_for_rss_hackers/

So they fetch full feeds even when nothing has changed.  I tried writing
my own external fetcher which does Etags and If-modified-since but I
still have the repeat article problem.  I also tried to figure out the
repeat thing but could never manage it.  In the end it seemed like it
would be faster for me to write nngreader :)  Of course, there's no
proof in that pudding yet so who am I to talk?




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

* Re: Using nnrss very actively
  2008-10-28  0:04                 ` Mark Plaksin
@ 2008-10-28  5:20                   ` Andreas Seltenreich
  2008-10-28 12:11                     ` Mark Plaksin
  0 siblings, 1 reply; 34+ messages in thread
From: Andreas Seltenreich @ 2008-10-28  5:20 UTC (permalink / raw)
  To: ding

Mark Plaksin writes:

> One last note about this.  Neither the internal nor external fetch
> methods of nnrss do the right thing with Etags or If-modified-since.
> So they fetch full feeds even when nothing has changed.

Last time I checked, nnrss did the right thing with If-modified-since
headers when mm-url-use-external is nil and url-automatic-caching is
set.

> I tried writing my own external fetcher which does Etags and
> If-modified-since but I still have the repeat article problem.  I also
> tried to figure out the repeat thing but could never manage it.

In No Gnus, there's `nnrss-ignore-article-fields' to deal with
duplicated articles.

regards,
andreas



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

* Re: Using nnrss very actively
  2008-10-28  5:20                   ` Andreas Seltenreich
@ 2008-10-28 12:11                     ` Mark Plaksin
  2008-10-31  8:00                       ` nnrss-ignore-article-fields for more than just fields jidanni
  0 siblings, 1 reply; 34+ messages in thread
From: Mark Plaksin @ 2008-10-28 12:11 UTC (permalink / raw)
  To: ding

Andreas Seltenreich <andreas+ding@gate450.dyndns.org> writes:

> Mark Plaksin writes:
>
>> One last note about this.  Neither the internal nor external fetch
>> methods of nnrss do the right thing with Etags or If-modified-since.
>> So they fetch full feeds even when nothing has changed.
>
> Last time I checked, nnrss did the right thing with If-modified-since
> headers when mm-url-use-external is nil and url-automatic-caching is
> set.

Cool!  It's been a while since I checked.  I have no patience and read
too many feeds so I'm "forced" to use-external :)

>> I tried writing my own external fetcher which does Etags and
>> If-modified-since but I still have the repeat article problem.  I also
>> tried to figure out the repeat thing but could never manage it.
>
> In No Gnus, there's `nnrss-ignore-article-fields' to deal with
> duplicated articles.

True.  Does anybody have a nice value for that variable that they can
share?  I tried using it for a while but it seems like you have to track
down the right fields to ignore for every feed that you read (or at
least every one that produces dupes).




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

* nnrss-ignore-article-fields for more than just fields
  2008-10-28 12:11                     ` Mark Plaksin
@ 2008-10-31  8:00                       ` jidanni
  2008-10-31 17:39                         ` Ted Zlatanov
  0 siblings, 1 reply; 34+ messages in thread
From: jidanni @ 2008-10-31  8:00 UTC (permalink / raw)
  To: ding

> In No Gnus, there's `nnrss-ignore-article-fields' to deal with
> duplicated articles.

nnrss-ignore-article-fields is a variable defined in `nnrss.el'.
Its value is (slash:comments)

Is that something to do with Slashdot? Perhaps its a
Slash:Comments: 44 field?

Anyway, here's the difference between two articles I wish nnrss would
consider the same
8c8
< Message-ID: <496@TorrentFreak.nnrss>
---
> Message-ID: <512@TorrentFreak.nnrss>
72,75c72
< href="http://torrentfreak.com">Torre
< href="http://feedads.googleadservice
< src="http://feedads.googleadservices
< border="0" ismap="true"></img></a></
---
> href="http://torrentfreak.com">Torre
94c91
< <p><a href="http://feedads.googleads
---
> 


Here's another pair:
4c4
< Date: Tue, 06 May 2008 09:6:46 EST
---
> Date: Sat, 10 May 2008 10:10:56 EST
7c7
< Message-ID: <13@LiveScience.com_Envi
---
> Message-ID: <17@LiveScience.com_Envi
11,14c11,12
< How we treat Earth involves trillion
< of individuals.<img
< src="http://feeds.livescience.com/~r
< height="1" width="1"/>
---
> How we treat Earth involves trillion
> src="http://feeds.livescience.com/~r

I.e., I need not be informed of a slight rewrite of their article, in
_some_ groups only, not all. So what should I set
nnrss-ignore-article-fields to?



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

* Re: nnrss-ignore-article-fields for more than just fields
  2008-10-31  8:00                       ` nnrss-ignore-article-fields for more than just fields jidanni
@ 2008-10-31 17:39                         ` Ted Zlatanov
  2008-11-10 22:04                           ` Ted Zlatanov
  0 siblings, 1 reply; 34+ messages in thread
From: Ted Zlatanov @ 2008-10-31 17:39 UTC (permalink / raw)
  To: ding

On Fri, 31 Oct 2008 16:00:40 +0800 jidanni@jidanni.org wrote: 

>> In No Gnus, there's `nnrss-ignore-article-fields' to deal with
>> duplicated articles.

j> Is that something to do with Slashdot? Perhaps its a
j> Slash:Comments: 44 field?

Yes, slash:comments update very often.

j> Anyway, here's the difference between two articles I wish nnrss would
j> consider the same
j> 8c8
j> < Message-ID: <496@TorrentFreak.nnrss>
j> ---
>> Message-ID: <512@TorrentFreak.nnrss>
j> 72,75c72
j> < href="http://torrentfreak.com">Torre
j> < href="http://feedads.googleadservice
j> < src="http://feedads.googleadservices
j> < border="0" ismap="true"></img></a></
j> ---
>> href="http://torrentfreak.com">Torre
j> 94c91
j> < <p><a href="http://feedads.googleads
j> ---
>> 

j> I.e., I need not be informed of a slight rewrite of their article, in
j> _some_ groups only, not all. So what should I set
j> nnrss-ignore-article-fields to?

Check my earlier post (I'm waiting for Reiner to approve its commit to
CVS, but the patch is appended).  This will show you each checked RSS
item as a Lisp structure so you can see which fields are duplicated.
FWIW I disabled "description" and now Reddit works OK.

Index: nnrss.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnrss.el,v
retrieving revision 7.59
diff -c -r7.59 nnrss.el
*** nnrss.el    11 Jun 2008 14:19:44 -0000      7.59
--- nnrss.el    31 Oct 2008 17:38:01 -0000
***************
*** 684,691 ****
      (buffer-string)))
  
  ;;; Snarf functions
- 
  (defun nnrss-make-hash-index (item)
    (setq item (gnus-remove-if
              (lambda (field)
                (when (listp field)
--- 684,691 ----
      (buffer-string)))
  
  ;;; Snarf functions
  (defun nnrss-make-hash-index (item)
+   (gnus-message 9 "nnrss: Making hash index of %s" (gnus-prin1-to-string item))
    (setq item (gnus-remove-if
              (lambda (field)
                (when (listp field)




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

* Content-Location for w3m display (was: Using nnrss very actively)
  2008-10-25  0:03     ` Kevin Ryde
@ 2008-11-03 23:43       ` Kevin Ryde
  0 siblings, 0 replies; 34+ messages in thread
From: Kevin Ryde @ 2008-11-03 23:43 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 905 bytes --]

Speaking of Content-Location, I see w3m-region in
mm-inline-text-html-render-with-w3m can be passed a url location so
relative links and images go to the right place.  I wonder if something
like below could pass that through from RFC2557 mhtml parts.

The decode bit is fairly nasty, because I believe in a multipart it's
necessary to propagate the Content-Location down into subparts (if they
don't have their own Content-Location).  Or at least that's my reading
of the rfc and the sample messages at
http://people.dsv.su.se/~jpalme/ietf/mhtml-test/mhtml.html

On those samples you can see the relative links for the images come out
right with w3m-region passed the Content-Location urls.  (Looking just
with describe-char if you've got image display disabled, as I do, and
without worrying, yet, whether w3m can pick out the image contents from
the multipart/related parts instead of downloading ...)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: mm-view.el.content-location.diff --]
[-- Type: text/x-diff, Size: 514 bytes --]

--- mm-view.el	04 Nov 2008 10:26:46 +1100	7.59
+++ mm-view.el	04 Nov 2008 10:26:55 +1100	
@@ -257,7 +257,8 @@
 	    (insert (mm-decode-string text charset))))
 	(let ((w3m-safe-url-regexp mm-w3m-safe-url-regexp)
 	      w3m-force-redisplay)
-	  (w3m-region (point-min) (point-max) nil charset))
+	  (w3m-region (point-min) (point-max)
+                      (mm-handle-content-location handle) charset))
 	(when (and mm-inline-text-html-with-w3m-keymap
 		   (boundp 'w3m-minor-mode-map)
 		   w3m-minor-mode-map)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: mm-decode.el.content-location.diff --]
[-- Type: text/x-diff, Size: 4098 bytes --]

--- mm-decode.el	04 Nov 2008 10:27:16 +1100	7.68
+++ mm-decode.el	04 Nov 2008 10:27:23 +1100	
@@ -89,6 +89,8 @@
   `(setcar (nthcdr 6 ,handle) ,contents))
 (defmacro mm-handle-id (handle)
   `(nth 7 ,handle))
+(defmacro mm-handle-content-location (handle)
+  `(nth 8 ,handle))
 (defmacro mm-handle-multipart-original-buffer (handle)
   `(get-text-property 0 'buffer (car ,handle)))
 (defmacro mm-handle-multipart-from (handle)
@@ -98,9 +100,9 @@
 
 (defmacro mm-make-handle (&optional buffer type encoding undisplayer
 				    disposition description cache
-				    id)
+				    id content-location)
   `(list ,buffer ,type ,encoding ,undisplayer
-	 ,disposition ,description ,cache ,id))
+	 ,disposition ,description ,cache ,id ,content-location))
 
 (defcustom mm-text-html-renderer
   (cond ((executable-find "w3m")
@@ -550,7 +552,7 @@
     (message "Destroying external MIME viewers")
     (mm-destroy-parts mm-postponed-undisplay-list)))
 
-(defun mm-dissect-buffer (&optional no-strict-mime loose-mime from)
+(defun mm-dissect-buffer (&optional no-strict-mime loose-mime from content-location)
   "Dissect the current buffer and return a list of MIME handles."
   (save-excursion
     (let (ct ctl type subtype cte cd description id result)
@@ -564,7 +566,9 @@
 		cte (mail-fetch-field "content-transfer-encoding")
 		cd (mail-fetch-field "content-disposition")
 		description (mail-fetch-field "content-description")
-		id (mail-fetch-field "content-id"))
+		id (mail-fetch-field "content-id")
+		content-location (or (mail-fetch-field "content-location")
+                                     content-location))
 	  (unless from
 	    (setq from (mail-fetch-field "from")))
 	  ;; FIXME: In some circumstances, this code is running within
@@ -583,7 +587,7 @@
 	   (and cte (intern (downcase (mail-header-strip cte))))
 	   no-strict-mime
 	   (and cd (mail-header-parse-content-disposition cd))
-	   description)
+	   description content-location)
 	(setq type (split-string (car ctl) "/"))
 	(setq subtype (cadr type)
 	      type (car type))
@@ -608,7 +612,7 @@
 					'from from
 					'start start)
 				  (car ctl))
-	     (cons (car ctl) (mm-dissect-multipart ctl from))))
+	     (cons (car ctl) (mm-dissect-multipart ctl from content-location))))
 	  (t
 	   (mm-possibly-verify-or-decrypt
 	    (mm-dissect-singlepart
@@ -616,7 +620,7 @@
 	     (and cte (intern (downcase (mail-header-strip cte))))
 	     no-strict-mime
 	     (and cd (mail-header-parse-content-disposition cd))
-	     description id)
+	     description id content-location)
 	    ctl))))
 	(when id
 	  (when (string-match " *<\\(.*\\)> *" id)
@@ -624,15 +628,15 @@
 	  (push (cons id result) mm-content-id-alist))
 	result))))
 
-(defun mm-dissect-singlepart (ctl cte &optional force cdl description id)
+(defun mm-dissect-singlepart (ctl cte &optional force cdl description id content-location)
   (when (or force
 	    (if (equal "text/plain" (car ctl))
 		(assoc 'format ctl)
 	      t))
     (mm-make-handle
-     (mm-copy-to-buffer) ctl cte nil cdl description nil id)))
+     (mm-copy-to-buffer) ctl cte nil cdl description nil id content-location)))
 
-(defun mm-dissect-multipart (ctl from)
+(defun mm-dissect-multipart (ctl from content-location)
   (goto-char (point-min))
   (let* ((boundary (concat "\n--" (mail-content-type-get ctl 'boundary)))
 	 (close-delimiter (concat (regexp-quote boundary) "--[ \t]*$"))
@@ -649,7 +653,7 @@
 	(save-excursion
 	  (save-restriction
 	    (narrow-to-region start (point))
-	    (setq parts (nconc (list (mm-dissect-buffer t nil from)) parts)))))
+	    (setq parts (nconc (list (mm-dissect-buffer t nil from content-location)) parts)))))
       (end-of-line 2)
       (or (looking-at boundary)
 	  (forward-line 1))
@@ -658,7 +662,7 @@
       (save-excursion
 	(save-restriction
 	  (narrow-to-region start end)
-	  (setq parts (nconc (list (mm-dissect-buffer t nil from)) parts)))))
+	  (setq parts (nconc (list (mm-dissect-buffer t nil from content-location)) parts)))))
     (mm-possibly-verify-or-decrypt (nreverse parts) ctl)))
 
 (defun mm-copy-to-buffer ()

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

* Re: nnrss-ignore-article-fields for more than just fields
  2008-10-31 17:39                         ` Ted Zlatanov
@ 2008-11-10 22:04                           ` Ted Zlatanov
  2008-11-11  7:37                             ` Reiner Steib
  2008-11-19 22:41                             ` Adam Sjøgren
  0 siblings, 2 replies; 34+ messages in thread
From: Ted Zlatanov @ 2008-11-10 22:04 UTC (permalink / raw)
  To: ding

On Fri, 31 Oct 2008 12:39:23 -0500 Ted Zlatanov <tzz@lifelogs.com> wrote: 

TZ> Index: nnrss.el
TZ> ===================================================================
TZ> RCS file: /usr/local/cvsroot/gnus/lisp/nnrss.el,v
TZ> retrieving revision 7.59
TZ> diff -c -r7.59 nnrss.el
TZ> *** nnrss.el    11 Jun 2008 14:19:44 -0000      7.59
TZ> --- nnrss.el    31 Oct 2008 17:38:01 -0000
TZ> ***************
TZ> *** 684,691 ****
TZ>       (buffer-string)))
  
TZ>   ;;; Snarf functions
TZ> - 
TZ>   (defun nnrss-make-hash-index (item)
TZ>     (setq item (gnus-remove-if
TZ>               (lambda (field)
TZ>                 (when (listp field)
TZ> --- 684,691 ----
TZ>       (buffer-string)))
  
TZ>   ;;; Snarf functions
TZ>   (defun nnrss-make-hash-index (item)
TZ> +   (gnus-message 9 "nnrss: Making hash index of %s" (gnus-prin1-to-string item))
TZ>     (setq item (gnus-remove-if
TZ>               (lambda (field)
TZ>                 (when (listp field)

Reiner, can I commit this?  It's just for debugging and very useful.

Ted




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

* Re: nnrss-ignore-article-fields for more than just fields
  2008-11-10 22:04                           ` Ted Zlatanov
@ 2008-11-11  7:37                             ` Reiner Steib
  2008-11-11 14:38                               ` Ted Zlatanov
  2008-11-19 22:41                             ` Adam Sjøgren
  1 sibling, 1 reply; 34+ messages in thread
From: Reiner Steib @ 2008-11-11  7:37 UTC (permalink / raw)
  To: ding

On Mon, Nov 10 2008, Ted Zlatanov wrote:

> TZ> +   (gnus-message 9 "nnrss: Making hash index of %s" (gnus-prin1-to-string item))
>
> Reiner, can I commit this?  It's just for debugging and very useful.

Sure.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

* Re: nnrss-ignore-article-fields for more than just fields
  2008-11-11  7:37                             ` Reiner Steib
@ 2008-11-11 14:38                               ` Ted Zlatanov
  0 siblings, 0 replies; 34+ messages in thread
From: Ted Zlatanov @ 2008-11-11 14:38 UTC (permalink / raw)
  To: ding

On Tue, 11 Nov 2008 08:37:55 +0100 Reiner Steib <reinersteib+gmane@imap.cc> wrote: 

RS> On Mon, Nov 10 2008, Ted Zlatanov wrote:
TZ> +   (gnus-message 9 "nnrss: Making hash index of %s" (gnus-prin1-to-string item))
>> 
>> Reiner, can I commit this?  It's just for debugging and very useful.

RS> Sure.

Done, thanks.

Ted



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

* Re: nnrss-ignore-article-fields for more than just fields
  2008-11-10 22:04                           ` Ted Zlatanov
  2008-11-11  7:37                             ` Reiner Steib
@ 2008-11-19 22:41                             ` Adam Sjøgren
  2008-11-20 16:40                               ` Ted Zlatanov
  1 sibling, 1 reply; 34+ messages in thread
From: Adam Sjøgren @ 2008-11-19 22:41 UTC (permalink / raw)
  To: ding

On Mon, 10 Nov 2008 16:04:02 -0600, Ted wrote:

TZ> ;;; Snarf functions
TZ> (defun nnrss-make-hash-index (item)
TZ> +   (gnus-message 9 "nnrss: Making hash index of %s" (gnus-prin1-to-string item))
TZ> (setq item (gnus-remove-if
TZ> (lambda (field)
TZ> (when (listp field)

Wouldn't this gnus-message call be (even) more useful if it was placed
_after_ the gnus-remove-if thing that removes the fields listed in
nnrss-ignore-article-fields?

I.e.:

--- lisp/nnrss.el	11 Nov 2008 14:38:16 -0000	7.60
+++ lisp/nnrss.el	19 Nov 2008 22:39:40 -0000
@@ -685,12 +685,12 @@
 
 ;;; Snarf functions
 (defun nnrss-make-hash-index (item)
-  (gnus-message 9 "nnrss: Making hash index of %s" (gnus-prin1-to-string item))
   (setq item (gnus-remove-if
 	      (lambda (field)
 		(when (listp field)
 		  (memq (car field) nnrss-ignore-article-fields)))
 	      item))
+  (gnus-message 9 "nnrss: Making hash index of %s" (gnus-prin1-to-string item))
   (md5 (gnus-prin1-to-string item)
        nil nil
        nnrss-file-coding-system))

(This way I can use it to check that I set nnrss-ignore-article-fields
correctly.)


  Best regards,

     Adam

-- 
 "If I succeed it seems to me                                 Adam Sjøgren
  That we should tell it to people like me"              asjo@koldfront.dk




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

* Re: nnrss-ignore-article-fields for more than just fields
  2008-11-19 22:41                             ` Adam Sjøgren
@ 2008-11-20 16:40                               ` Ted Zlatanov
  0 siblings, 0 replies; 34+ messages in thread
From: Ted Zlatanov @ 2008-11-20 16:40 UTC (permalink / raw)
  To: ding

On Wed, 19 Nov 2008 23:41:14 +0100 asjo@koldfront.dk (Adam Sjøgren) wrote: 

AS> On Mon, 10 Nov 2008 16:04:02 -0600, Ted wrote:
TZ> ;;; Snarf functions
TZ> (defun nnrss-make-hash-index (item)
TZ> +   (gnus-message 9 "nnrss: Making hash index of %s" (gnus-prin1-to-string item))
TZ> (setq item (gnus-remove-if
TZ> (lambda (field)
TZ> (when (listp field)

AS> Wouldn't this gnus-message call be (even) more useful if it was placed
AS> _after_ the gnus-remove-if thing that removes the fields listed in
AS> nnrss-ignore-article-fields?
...
AS> (This way I can use it to check that I set nnrss-ignore-article-fields
AS> correctly.)

The purpose (for me) was to show the original message, before anything
is touched.  Thus the log message is misleading and should be "Raw RSS
item: %s" instead.  I don't think we need to show the modified message
as well, but it's not a strongly held opinion.

Ted




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

end of thread, other threads:[~2008-11-20 16:40 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-16 13:00 Using nnrss very actively Lars Magne Ingebrigtsen
2008-10-16 13:15 ` David Engster
2008-10-16 13:27   ` Lars Magne Ingebrigtsen
2008-10-16 13:43     ` David Engster
2008-10-16 13:52       ` Lars Magne Ingebrigtsen
2008-10-16 16:27         ` Mark Plaksin
2008-10-16 17:15           ` Lars Magne Ingebrigtsen
2008-10-17  8:45             ` Paul R
2008-10-17  8:57               ` David Engster
2008-10-17  9:18                 ` Paul R
2008-10-17 14:00             ` Andreas Seltenreich
2008-10-16 17:46           ` Robert D. Crawford
2008-10-16 19:27             ` David Engster
2008-10-20 17:13               ` Mark Plaksin
2008-10-21 15:53                 ` Ted Zlatanov
2008-10-21 16:24                 ` Adam Sjøgren
2008-10-28  0:04                 ` Mark Plaksin
2008-10-28  5:20                   ` Andreas Seltenreich
2008-10-28 12:11                     ` Mark Plaksin
2008-10-31  8:00                       ` nnrss-ignore-article-fields for more than just fields jidanni
2008-10-31 17:39                         ` Ted Zlatanov
2008-11-10 22:04                           ` Ted Zlatanov
2008-11-11  7:37                             ` Reiner Steib
2008-11-11 14:38                               ` Ted Zlatanov
2008-11-19 22:41                             ` Adam Sjøgren
2008-11-20 16:40                               ` Ted Zlatanov
2008-10-16 13:17 ` Using nnrss very actively Robert D. Crawford
2008-10-16 13:18 ` Adam Sjøgren
2008-10-18 23:10 ` Sebastian Krause
2008-10-18 23:16 ` Kevin Ryde
2008-10-20 20:20   ` Lars Magne Ingebrigtsen
2008-10-21 15:56     ` Ted Zlatanov
2008-10-25  0:03     ` Kevin Ryde
2008-11-03 23:43       ` Content-Location for w3m display (was: Using nnrss very actively) Kevin Ryde

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