The weather in a form.

radek225

Registered User.
Local time
Yesterday, 20:04
Joined
Apr 4, 2013
Messages
307
Someone know, how to get actual weather and paste into a textbox in a form?
e.g.
windy, 22°C
 
look out the window, type in what you see?

Where do you want to get the weather from? if you are cutting pasting just google 'weather in ??' you'll find plenty of sites so copy and paste from there
 
look out the window, type in what you see?
attachment.php
 
It is not clear what you are trying to do. I agree with CJ that looking out the window will certainly do the job.

It you want to go to a website and get info for some location, that is possible -- but will need some coding and refinement and details of what exactly you are trying to do.

There was a post see http://www.access-programmers.co.uk/forums/showthread.php?t=240796 that I was interested in. I followed some o the dialog, got a wundergroud key, read their info and built the following. It gives me some info re weather for 10 days at Ottawa International Airport.

Code:
'---------------------------------------------------------------------------------------
' Procedure : Wunderground
' Author    : Jack
' Date      : 11/5/2013
' Purpose   : Using Wunderground link, get a 10 day forecast or airport YOW (ottawa, ON, Canada)
'
' see http://www.access-programmers.co.uk/forums/showthread.php?t=240796
' There was other info on UtterAccess, but uses excel...
' see http://www.utteraccess.com/forum/Pull-Data-Website-t1999204.html
'---------------------------------------------------------------------------------------
'
Sub Wunderground()

      Dim MyKey As String
10    MyKey = "1e197398857b6741" ' I got this key May 11 2013  JED
      Dim Req As New XMLHTTP
      Dim Resp As New DOMDocument
      Dim Weather As IXMLDOMNode
20    Req.Open "GET", "http://api.wunderground.com/api/" _
            & MyKey _
            & "/hourly10day/q/CA/Yow.xml", False
30    Req.send

40     While Req.Status <> 200
50       Debug.Print "waiting for response*** info"
60        DoEvents
70     Wend
       
80     Resp.loadXML Req.responseText
90    Debug.Print Resp.xml
100   For Each Forecast In Resp.getElementsByTagName("forecast")
110       Debug.Print Forecast.SelectNodes("FCTTIME")(0).SelectNodes("pretty")(0).text
          'Debug.Print Forecast.SelectNodes("FCTTIME")(0).SelectNodes("hour")(0).text
120       Debug.Print "Temp C:   " & Forecast.SelectNodes("temp")(0).SelectNodes("metric")(0).text
130       Debug.Print "Condition: " & Forecast.SelectNodes("condition")(0).text
140       Debug.Print
150   Next
End Sub


Some output
Code:
...........
3:00 PM EDT on October 26, 2013
Temp C:   8
Condition: Clear

4:00 PM EDT on October 26, 2013
Temp C:   7
Condition: Clear

5:00 PM EDT on October 26, 2013
Temp C:   7
Condition: Partly Cloudy
...............

You may get additional info at http://www.wunderground.com/weather/api/
and http://www.wunderground.com/weather/api/d/docs

Good luck with your project. Please let us know how it goes.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom