xerox: fix open-uri usage

This commit is contained in:
Astro 2023-09-05 17:25:14 +02:00
parent 35bbd65a50
commit 4801d49c7a
1 changed files with 2 additions and 2 deletions

View File

@ -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)