Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: ding@gnus.org
Subject: Re: Html header washing question
Date: Tue, 06 Nov 2012 10:05:24 +0900	[thread overview]
Message-ID: <b4mehk7h76z.fsf@jpl.org> (raw)
In-Reply-To: <87vcdjyhug.fsf@gmx.co.uk>

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



      reply	other threads:[~2012-11-06  1:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-05 19:23 Johnny
2012-11-06  1:05 ` Katsumi Yamaoka [this message]

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=b4mehk7h76z.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=ding@gnus.org \
    /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).