Skip to content
Browse files

Feed raw string to nokogiri to prevent encoding issues

  • Loading branch information...
1 parent e304f21 commit 2c04c67eafe1e92d1fb48b3aaf1e1c4f772fce50 @hulihanapplications committed Dec 13, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/fletcher/data.rb
View
4 lib/fletcher/data.rb
@@ -6,12 +6,12 @@ module Fletcher
class Data
# Get read url and get data object
def self.read(url)
- remote_file = open(url)
+ remote_file = open(url).read
doc = ::Nokogiri::HTML(remote_file)
# Save contents of URL/Remote File
#last_url_file = File.expand_path(File.join("..", "..", "remote_file"), File.dirname(__FILE__))
#File.new(last_url_file, "w+").write(remote_file.read)
end
end
-end
+end

0 comments on commit 2c04c67

Please sign in to comment.
Something went wrong with that request. Please try again.