Google XML Weather Feed with Classic ASP

This took me a few days to get working and it drives me crazy because of how simple it is. My problem is that I tried to do it in Javascript first and my Javascript skills aren’t up to my ASP skills.

It is actually quite simple and here is the code.

*******************

set xmlHTTP = server.createobject("Microsoft.XMLHTTP")
xmlHTTP.open "Get", "http://www.google.com/ig/api?weather=philadelphia,pa", 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
conditionstext = xml.documentElement.childNodes(0).firstChild.nextSibling.childNodes(0).attributes(0).nodeValue
conditionsicon = xml.documentElement.childNodes(0).childNodes(2).childNodes(3).attributes(0).Value

*******************

Then you can just response.write the values where you need them.

Bringing the object back was pretty easy, but traversing the DOM to get the information that I was looking for was a real pain. A combination of Firefox and Firebug made selecting what I needed a lot easier.

You will also notice that I have ‘philadephia, pa’ harcoded into the URL, but where this is being used, I use an IP locator to get the IP address of the user, convert that to a city and state and put that value into the URL, so that users can get their own weather and not mine.

Also ‘conditionsicon’ brings back a relative URL to an icon image for the current conditions. If anyone has a list of all possible conditions that would be amazingly helpful.

The Devil Wears Prada

I’m a little behind in my reviews, and I thought I’d catch up with what may actually be the best movie of the summer.

The story is pretty simple and most people are familiar with it at this point. Anne Hatheway is a beginning journalist wanna be and Meryl Streep is her satan like boss.

Meryl Streep comes alive and just eats this part up as the devilish boss of a world reknown fashion magazine. As Anne Hatheway stumbles through her best attempts to please her boss, Meryl Streep digs in, and digs, and digs and never lets up.

Even at the end of the movie when we get our ‘everythings peachy’ ending, Meryl Streep still doesn’t let up enough to make it seem feel good.

Most men will probably want to avoid this movie, as was evident by the proportion of women to men at the showing that I was at. But I wouldn’t pigeon hole this as a chick flick just because it’s about a fashion magazine and has an almost all women cast. This is basically an evil boss movie and I think that’s something almost everyone can relate to.