diff --git a/xerox/scrape.rb b/xerox/scrape.rb index b96e5c0..4de14fc 100644 --- a/xerox/scrape.rb +++ b/xerox/scrape.rb @@ -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)