Re: Converting html to text

Mark Keisler <[email protected]> Sun, 24 Apr 2011 23:35:02 -0500
Newsgroups gmane.org.user-groups.luni.tech
Message-ID <[email protected]>
On Sat, Apr 23, 2011 at 7:24 PM, Martin Maney <[email protected]> wrote:

>
> This reminds me of something I was looking for the other day.  I prefer
> to read email in text mode, but occasionally I have to dig the couple
> lines of information out of a thousand lines of tortured HTML (why is
> it that these things are always the worst sort of old-school HTML
> hacks, full of zero-width images and other trash?).  At some time in
> the past there was a little CLI filter named hmtl2txt (or something
> like that) that I would use... at some upgrade it went missing, not
> sure when.  The other day I wanted it enough to poke around, and I
> ended up with this one-line shell script:
>
>  w3m -dump -T text/html
>
> Okay, two lines with standard #! header when saved to ~/bin so I don't
> have to type all that.  I suppose I could attach it to mutt more
> intimately, but it's occasionally useful outside the email reader.
>
> (I think the previous html2txt went missing because it was built around
> a similar use of lynx, which is no longer commonly installed.  The
> above is not as general as the older tool - it only works as a filter
> and doesn't allow any of the gazillion options w3m does.  Perfect!)
>
> --
> River lines, defensible passes, the posession of hills and
> encirclement of cities; these are the syntax that structures
> the speech of guns.  -- John M. Ford
>
> --
> Linux Users Of Northern Illinois (Chicago) - Technical Discussion
> http://luni.org/mailman/listinfo/luni
>

mutt doesn't have a html2text renderer like (al)pine?
At any rate, html2text is at http://www.mbayer.de/html2text/index.shtml and
it doesn't use lynx.  Also there is a python html2text at
http://www.aaronsw.com/2002/html2text/ (also no dependent on lynx).

-- 
Linux Users Of Northern Illinois (Chicago) - Technical Discussion 
http://luni.org/mailman/listinfo/luni