--- harvester-orig/generate.rb 2013-01-10 12:26:14.145831300 +0100 +++ harvester/generate.rb 2013-01-10 12:59:54.435890484 +0100 @@ -11,10 +11,11 @@ end require 'time' require 'iconv' +require 'uri' begin - require 'hpricot' + require 'nokogiri' rescue LoadError - $stderr.puts "Hpricot not found, will not mangle relative links in " + $stderr.puts "Nokogiri not found, will not mangle relative links in " end # Slow monkey patching for recently commented function in Ruby's time library (sigh) @@ -30,9 +31,9 @@ end def absolutize(base) - if defined? Hpricot + if defined? Nokogiri::HTML() begin - html = Hpricot("#{@body}") + html = Nokogiri::HTML("#{@body}") (html/'a').each { |a| begin f = a.get_attribute('href') @@ -54,7 +55,7 @@ end } html.search('/html/body/*').to_s - rescue Hpricot::Error => e + rescue Nokogiri::XML::SyntaxError => e $stderr.puts "Oops: #{e}" @body end