diff --git a/README.md b/README.md index a11c46a..ff87360 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Example require 'readability' require 'open-uri' - source = open('http://lab.arc90.com/experiments/readability/').read + source = URI.parse('http://lab.arc90.com/experiments/readability/').read puts Readability::Document.new(source).content diff --git a/bin/readability b/bin/readability index 1c5b4dc..b8a7011 100755 --- a/bin/readability +++ b/bin/readability @@ -2,7 +2,7 @@ require 'rubygems' require 'open-uri' require 'optparse' -require File.dirname(__FILE__) + '/../lib/readability' +require_relative '../lib/readability' options = { :debug => false, :images => false } options_parser = OptionParser.new do |opts| @@ -28,7 +28,7 @@ if ARGV.length != 1 exit 1 end -text = open(ARGV.first).read +text = URI.parse(ARGV.first).read params = if options[:images] { :tags => %w[div p img a], :attributes => %w[src href],