Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Gettting xml values from google API in ASP classic

Avatar of electricd7
electricd7 asked on
ASPXMLVB Script
13 Comments1 Solution1439 ViewsLast Modified:
Hello,

I have the contents of the google weather XML file stored using server.createobject("Microsoft.XMLHTTP").  I just need to know how to get the values I want into variables.  I found some code on the web and got most of it, but can't seem to get the last updated date/time.  I just don't understand exactly what I am looking at.  I will post the code below.  I would really like to know how to get all the values into variables, but this is as far as I have gotten so far.  The one I am primarily concerned with is reportTime.  Thanks!
zip = "47804"

'Google API Weather Call
set xmlHTTP = server.createobject("Microsoft.XMLHTTP")
xmlHTTP.open "Get", "http://www.google.com/ig/api?weather="&Zip, false
xmlHTTP.send()
Set xml = xmlHTTP.ResponseXml


city = xml.documentElement.childNodes(0).firstChild.firstChild.attributes(0).nodeValue
currenttemp = xml.documentElement.childNodes(0).firstChild.nextSibling.childNodes(1).attributes(0).nodeValue
humidity = xml.documentElement.childNodes(0).firstChild.nextSibling.childNodes(3).attributes(0).nodeValue
conditionstext = xml.documentElement.childNodes(0).firstChild.nextSibling.childNodes(0).attributes(0).nodeValue
conditionsicon = xml.documentElement.childNodes(0).childNodes(2).childNodes(3).attributes(0).Value
winds = xml.documentElement.childNodes(0).firstChild.nextSibling.childNodes(5).attributes(0).nodeValue
reportTime = xml.documentElement.childNodes(1).firstChild.text

response.write City&"<br>"
response.write currenttemp&"<br>"
response.write conditionstext&"<br>"
response.write humidity&"<br>"
response.write winds&"<br>"
response.write "<img src='http://google.com/"&conditionsicon&"'><br>"
response.write reportTime
ASKER CERTIFIED SOLUTION
Avatar of LeroyJames
LeroyJames

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 13 Comments.
See Answers