nokorexi 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/nokorexi.rb +3 -2
- metadata +1 -1
data/lib/nokorexi.rb
CHANGED
@@ -4,14 +4,15 @@
|
|
4
4
|
|
5
5
|
require 'nokogiri'
|
6
6
|
require 'open-uri'
|
7
|
-
require '
|
7
|
+
require 'rexml/document'
|
8
|
+
include REXML
|
8
9
|
|
9
10
|
class Nokorexi
|
10
11
|
|
11
12
|
def initialize(buffer)
|
12
13
|
buffer = open(buffer, 'UserAgent' => 'Nokorexi').read if buffer[/^http/]
|
13
14
|
raw_doc = Nokogiri::HTML(buffer)
|
14
|
-
@doc =
|
15
|
+
@doc = Document.new(raw_doc.xpath('html/body').to_xml)
|
15
16
|
end
|
16
17
|
|
17
18
|
def to_doc
|