fhem, freifunk, impfee, matemat: use open-uri properly
This commit is contained in:
parent
4801d49c7a
commit
d93045ab74
|
@ -10,7 +10,7 @@ PASSWORD = ARGV[2]
|
||||||
|
|
||||||
points = []
|
points = []
|
||||||
|
|
||||||
doc = Nokogiri::HTML open("https://#{HOST}/fhem?room=all", :http_basic_authentication => [USER, PASSWORD])
|
doc = Nokogiri::HTML URI::open("https://#{HOST}/fhem?room=all", :http_basic_authentication => [USER, PASSWORD])
|
||||||
doc.css('.roomoverview tr').each do |row|
|
doc.css('.roomoverview tr').each do |row|
|
||||||
name = row.css('.col1').text
|
name = row.css('.col1').text
|
||||||
current = row.css('.col2').text
|
current = row.css('.col2').text
|
||||||
|
|
|
@ -7,7 +7,7 @@ require 'influxdb'
|
||||||
|
|
||||||
HOST = ARGV[0]
|
HOST = ARGV[0]
|
||||||
|
|
||||||
data = JSON.parse open("http://#{HOST}/sysinfo-json.cgi").read()
|
data = JSON.parse URI::open("http://#{HOST}/sysinfo-json.cgi").read()
|
||||||
|
|
||||||
$node_id = data['data']['common']['node']
|
$node_id = data['data']['common']['node']
|
||||||
$node_name = URI::decode(data['data']['contact']['name'])
|
$node_name = URI::decode(data['data']['contact']['name'])
|
||||||
|
|
|
@ -5,7 +5,7 @@ require 'json'
|
||||||
require 'influxdb'
|
require 'influxdb'
|
||||||
|
|
||||||
# https://www.countee.ch/app/de/counter/impfee/_iz_sachsen
|
# https://www.countee.ch/app/de/counter/impfee/_iz_sachsen
|
||||||
data = JSON.parse open("https://www.startupuniverse.ch/api/1.1/de/counters/getAll/_iz_sachsen").read()
|
data = JSON.parse URI::open("https://www.startupuniverse.ch/api/1.1/de/counters/getAll/_iz_sachsen").read()
|
||||||
|
|
||||||
points = []
|
points = []
|
||||||
data['response']['data'].each do |id, iz|
|
data['response']['data'].each do |id, iz|
|
||||||
|
|
|
@ -10,13 +10,13 @@ PASSWORD = ARGV[2]
|
||||||
|
|
||||||
points = []
|
points = []
|
||||||
|
|
||||||
data = JSON.parse open("https://#{HOST}/statistics.json", :http_basic_authentication => [USER, PASSWORD]).read()
|
data = JSON.parse URI::open("https://#{HOST}/statistics.json", :http_basic_authentication => [USER, PASSWORD]).read()
|
||||||
points.push({
|
points.push({
|
||||||
series: 'statistics',
|
series: 'statistics',
|
||||||
values: data.map { |(n, i)| [n, i.to_i] },
|
values: data.map { |(n, i)| [n, i.to_i] },
|
||||||
})
|
})
|
||||||
|
|
||||||
data = JSON.parse open("http://#{HOST}/summary.json", :http_basic_authentication => [USER, PASSWORD]).read()
|
data = JSON.parse URI::open("https://#{HOST}/summary.json", :http_basic_authentication => [USER, PASSWORD]).read()
|
||||||
data.each do |d|
|
data.each do |d|
|
||||||
points.push({
|
points.push({
|
||||||
series: 'summary',
|
series: 'summary',
|
||||||
|
|
Loading…
Reference in New Issue