Sha256: 83f74cc06ac50c5c0c2e1830607434344ce2aae2080615bcb5e8dac32d761c32
Contents?: true
Size: 521 Bytes
Versions: 1
Compression:
Stored size: 521 Bytes
Contents
require "dramavladimir/version" require 'nokogiri' require 'httpclient' require 'dramavladimir/repertoire' require 'dramavladimir/announce' module Dramavladimir NotFound = Class.new StandardError Empty = Class.new StandardError def self.fetch(url) HTTPClient.new.get url, nil, { 'User-Agent'=>'a', 'Accept-Encoding'=>'a' } end def self.parse(url) p = fetch url raise(Empty) if p.http_body.content.size.zero? p.status == 200 ? Nokogiri::XML(p.body.encode('utf-8')) : raise(NotFound) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
dramavladimir-0.1.1 | lib/dramavladimir.rb |