Gnus development mailing list
 help / color / mirror / Atom feed
* Html header washing question
@ 2012-11-05 19:23 Johnny
  2012-11-06  1:05 ` Katsumi Yamaoka
  0 siblings, 1 reply; 2+ messages in thread
From: Johnny @ 2012-11-05 19:23 UTC (permalink / raw)
  To: ding

Hi,

I have a RSS feed that sends html in the subject line, and I want to
display the text only; 
e.g. from:
<a href="/aktiebloggen/opcon-ett-bolag-pa-vag-fram">Opcon ett bolag på väg fram !</a>
to:
Opcon ett bolag på väg fram !

I have tried the "W h" and have mm-text-html-renderer set to "w3m" and
get the error "mm-get-part: Wrong type argument: bufferp,
#("multipart/alternative" 0 21 (boundary "=-=-=" buffer #<buffer
*mm*<19>> from "GordonGekko" start nil))".

Thanks!

-- 
Johnny



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

* Re: Html header washing question
  2012-11-05 19:23 Html header washing question Johnny
@ 2012-11-06  1:05 ` Katsumi Yamaoka
  0 siblings, 0 replies; 2+ messages in thread
From: Katsumi Yamaoka @ 2012-11-06  1:05 UTC (permalink / raw)
  To: ding

Johnny wrote:
> I have a RSS feed that sends html in the subject line, and I want to
> display the text only;
> e.g. from:
> <a href="/aktiebloggen/opcon-ett-bolag-pa-vag-fram">Opcon ett bolag på
> väg fram !</a>
> to:
> Opcon ett bolag på väg fram !

That is just what the xml feed contains as <title>...</title>.
I don't know what is the use of such one but I tried a filter:

(defadvice nnrss-node-text (before wash-subject (namespace local-name element)
				   activate)
  "Wash subject string for <http://www.redeye.se/aktiebloggen/feed>."
  (when (equal local-name 'title)
    (let* ((name (intern (concat namespace (symbol-name local-name))))
	   (node (assq name element))
	   (text (if (and node (listp node))
		     (nnrss-node-just-text node)
		   node)))
      (and text
	   (string-match "\\`<a href=\"/aktiebloggen/[^>]+>\\([^<]+\\)</a>"
			 text)
	   (setcdr node (list nil (match-string 1 text)))))))

(To try this, type `C-x C-e' at the end of the form, or add it
 to the ~/.gnus.el file.)

> I have tried the "W h" and have mm-text-html-renderer set to "w3m" and
> get the error "mm-get-part: Wrong type argument: bufferp,
> #("multipart/alternative" 0 21 (boundary "=-=-=" buffer #<buffer
> *mm*<19>> from "GordonGekko" start nil))".

That will be a bug anyway, though `W h' is useless for this case
(it will work on an html article that is not labeled as text/html
 by the Content-Type header).



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

end of thread, other threads:[~2012-11-06  1:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-05 19:23 Html header washing question Johnny
2012-11-06  1:05 ` 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).