Module: W3M

Defined in:
lib/rt/w3m.rb

Overview

w3m.rb $Id: w3m.rb 597 2005-10-18 21:03:12Z rubikitch $

— W3M.w3m(url, options=‘-e’)

invoke w3m.

— W3M.html2txt(htmlstr, options=‘-e’)

convert htmlstr to plain text.

— W3M.source(url, options=‘-e’)

get the source.

Class Method Summary collapse

Class Method Details

.html2txt(htmlstr, option = '-e') ⇒ Object



32
33
34
# File 'lib/rt/w3m.rb', line 32

def html2txt(htmlstr, option='-e')
  external_filter(htmlstr, "w3m -dump -T text/html #{option}")
end

.source(url, option = '') ⇒ Object



36
37
38
# File 'lib/rt/w3m.rb', line 36

def source(url, option='')
  open("| w3m -dump_source #{option} #{url}").readlines.join
end

.w3m(url, option = '-e') ⇒ Object



28
29
30
# File 'lib/rt/w3m.rb', line 28

def w3m(url, option='-e')
  open("| w3m -dump #{option} #{url}").readlines.join
end