我正在尝试从 Wunderground 获取信息以显示在我正在建设的气象站上
我可以使用 openweathermap.org 使其正常工作但我无法让 Wunderground 工作
任何人都可以提供帮助吗?
代码:
全选timesetup(1)
print time()
delay 1000
print time()
timer 10 * 1000, [RUNPROGRAM]
wait
[RUNPROGRAM]
cls
PRINT \"TIME\" & \",\" & time()
serialprintln \"TIME\" & \",\" & time()
let query = \"api.openweathermap.org/data/2.5/weather?q=Denton,uk〈=en&units=metric&appid=API_KEY_HERE\"
delay 500
let ret = wget(query)
let temp = json(ret,\"main.temp\")
let press = json(ret,\"main.pressure\")
let humid = json(ret,\"main.humidity\")
let speed = json(ret,\"main.speed\")
speed1 = int(main.speed + 0.5)
let dir = json(ret,\"main.deg\")
let icon = json(ret,\"main.icon\")
let desc = json(ret,\"description\")
println \"Today,\" & desc & \",\" & icon & \",\" & temp & \",\" & press &\",\" & speed1 & \",\" & dir & \",\" & humid
代码:
全选timesetup(1)
print time()
delay 1000
print time()
timer 10 * 1000, [RUNPROGRAM]
wait
[RUNPROGRAM]
cls
PRINT \"TIME\" & \",\" & time()
\'println \"TIME\" & \",\" & time()
let query = \"api.wunderground.com/api/API_KEY_HERE/conditions/q/UK/Audenshaw.json\"
delay 10
let ret = wget(query)
let temp = json(ret,\"temp_c\")
let press = json(ret,\"pressure_mb\")
let humid = json(ret,\"relative_humidity\")
let speed = json(ret,\"main.speed\")
speed1 = int(wind_mph)
let dir = json(ret,\"wind_degrees\")
let icon = json(ret,\"icon\")
let desc = json(ret,\"wind_string\")
println \"Today,\" & desc & \",\" & icon & \",\" & temp & \",\" & press &\",\" & speed1 & \",\" & dir & \",\" & humid