10 lines
418 B
JavaScript
10 lines
418 B
JavaScript
function requestTemperature() {
|
|
let response = context.http.fetch(
|
|
"https://api.openweathermap.org/data/2.5/weather?lat=50.98&lon=11.03&appid=21fa3d5930956682000f7a2db5f357c0"
|
|
)
|
|
let data = response.body.json()
|
|
let temperatureEntries = context.db.find("temperature")
|
|
context.db.update("temperature", temperatureEntries[0].id, { temperature: data.main.temp - 273.15 })
|
|
}
|
|
requestTemperature()
|