You only need to sign up for a free api key.
https://openweathermap.org/
- Code: Select all
var lat = "51.5942009"
var lon = "7.1368071"
// Your API-KEY
var appid = "your API Key here"
// Units: metric, imperial
var units = "metric"
// Output Language : de, en, fr ...
var lang = "de"
var url = "https://api.openweathermap.org/data/2.5/weather?"
var msg = url
msg += "lat=" + lat
msg += "&lon=" + lon
msg += "&units=" + units
msg += "&lang=" + lang
msg += "&appid=" + appid
var responsestr = ""
HTTPRequestToVar(msg,"responsestr","GET","application/json")
var weather = responsestr.ToJson
TextBox1.Clear
TextBox1.Append(weather.ToPrettyString)
var temp = weather.Get("main.temp")
var w_lst = weather.GetList("weather")
var j_desc = w_lst[0].ToJson
var desc = j_desc.GetString("description")
Label2.text = "Das Wetter in " + w.GetString("name") + " ist " + desc + " bei " + temp + "°C"