xerox: fix open-uri usage
This commit is contained in:
parent
35bbd65a50
commit
4801d49c7a
|
@ -10,7 +10,7 @@ PASSWORD = ARGV[2]
|
|||
def scrape_paper_supply
|
||||
results = {}
|
||||
|
||||
open("http://#{HOST}/sttray.htm", :http_basic_authentication => [USER, PASSWORD])
|
||||
URI.open("http://#{HOST}/sttray.htm", :http_basic_authentication => [USER, PASSWORD])
|
||||
.read()
|
||||
.scan(/\['Tray (.+?)',\d+,(\d+),/) do |m|
|
||||
|
||||
|
@ -23,7 +23,7 @@ end
|
|||
def scrape_consumables
|
||||
results = {}
|
||||
|
||||
doc = open("http://#{HOST}/stsply.htm", :http_basic_authentication => [USER, PASSWORD])
|
||||
doc = URI.open("http://#{HOST}/stsply.htm", :http_basic_authentication => [USER, PASSWORD])
|
||||
.read()
|
||||
.force_encoding("ISO-8859-1")
|
||||
.encode("utf-8", replace: nil)
|
||||
|
|
Loading…
Reference in New Issue