microformats2/lib/microformats2.rb
2013-04-18 22:13:34 -07:00

16 lines
268 B
Ruby

require "nokogiri"
require "open-uri"
require "microformats2/version"
module Microformats2
def self.parse(html)
html = read_html(html)
Nokogiri::HTML(html)
end
def self.read_html(html)
open(html).read
rescue Errno::ENOENT => e
html
end
end