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
|
def scrape_paper_supply
|
||||||
results = {}
|
results = {}
|
||||||
|
|
||||||
open("http://#{HOST}/sttray.htm", :http_basic_authentication => [USER, PASSWORD])
|
URI.open("http://#{HOST}/sttray.htm", :http_basic_authentication => [USER, PASSWORD])
|
||||||
.read()
|
.read()
|
||||||
.scan(/\['Tray (.+?)',\d+,(\d+),/) do |m|
|
.scan(/\['Tray (.+?)',\d+,(\d+),/) do |m|
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ end
|
||||||
def scrape_consumables
|
def scrape_consumables
|
||||||
results = {}
|
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()
|
.read()
|
||||||
.force_encoding("ISO-8859-1")
|
.force_encoding("ISO-8859-1")
|
||||||
.encode("utf-8", replace: nil)
|
.encode("utf-8", replace: nil)
|
||||||
|
|
Loading…
Reference in New Issue