Created
January 10, 2013 20:00
-
-
Save jaimeiniesta/4505289 to your computer and use it in GitHub Desktop.
Quick hack to be able to pass an HTML string to MetaInspector, bypassing the scraping of the document
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'metainspector' | |
module MetaInspector | |
class Scraper | |
attr_writer :document | |
end | |
end | |
page = MetaInspector.new('http://example.com') | |
page.document = "<html><head><title>hello</title></head></html>" | |
puts page.title # should be "hello", not "Example Domain" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment