Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
MsgBox, % get_weather("New York City") MsgBox, % get_weather("LAX") MsgBox, % get_weather(60007) MsgBox, % get_weather("28.47,81.46") ExitApp /* Location types: /paris ; city name /~Eiffel+tower ; any location (+ for spaces) /muc ; 3 letter airport codes /@stackoverflow.com ; domain name /94107 ; area codes /-78.46,106.79 ; GPS coordinates */ get_weather(location) { web := ComObjCreate("WinHttp.WinHttpRequest.5.1") Try web.Open("GET", "https://wttr.in/" location) , web.Send() , txt := web.ResponseText Catch Return 0 If (txt = "") Return 0 flag := breaker := txt1 := 0 Loop, Parse, % txt, `n, `r If !flag InStr(A_LoopField, "Weather report:") ? flag++ : "" Else If RegExMatch(A_LoopField, "(\s*)+(.*)$", txt) breaker++ Until (breaker) Return txt2 }