module Ruskino33Parser
Constants
- VERSION
Public Class Methods
fetch(url)
click to toggle source
# File lib/ruskino33_parser.rb, line 9 def self.fetch(url) HTTPClient.new.get url, nil, 'User-Agent' => 'a', 'Accept-Encoding' => 'a' end
parse(url)
click to toggle source
# File lib/ruskino33_parser.rb, line 13 def self.parse(url) p = fetch url fail(Empty) if p.http_body.content.size.zero? p.status == 200 ? Nokogiri::HTML(p.body.encode('utf-8')) : fail(NotFound) end