<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>StephenCollins.me &#187; ASP</title>
	<atom:link href="http://stephencollins.me/tag/asp/feed/" rel="self" type="application/rss+xml" />
	<link>http://stephencollins.me</link>
	<description></description>
	<lastBuildDate>Tue, 02 Feb 2010 17:42:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Google XML Weather Feed with Classic ASP</title>
		<link>http://stephencollins.me/2009/07/google-xml-weather-feed-with-classic-asp/</link>
		<comments>http://stephencollins.me/2009/07/google-xml-weather-feed-with-classic-asp/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 17:57:58 +0000</pubDate>
		<dc:creator>Stephen</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://stephencollins.me/?p=20</guid>
		<description><![CDATA[*Update* You can see this in action and try it out on www.constructionequipmentguide.com 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&#8217;t up to my ASP skills. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>*Update*<br />
You can see this in action and try it out on <a href="http://www.constructionequipmentguide.com">www.constructionequipmentguide.com</a></strong></p>
<p>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&#8217;t up to my ASP skills.</p>
<p>It is actually quite simple and here is the code.</p>
<p>*******************<br />
<code>set xmlHTTP = server.createobject("Microsoft.XMLHTTP")<br />
xmlHTTP.open "Get", "http://www.google.com/ig/api?weather=philadelphia,pa", false<br />
xmlHTTP.send()<br />
Set xml = xmlHTTP.ResponseXml</code></p>
<p><code> </code></p>
<p><code>city = xml.documentElement.childNodes(0).firstChild.firstChild.attributes(0).nodeValue<br />
currenttemp = xml.documentElement.childNodes(0).firstChild.nextSibling.childNodes(1).attributes(0).nodeValue<br />
conditionstext = xml.documentElement.childNodes(0).firstChild.nextSibling.childNodes(0).attributes(0).nodeValue<br />
conditionsicon = xml.documentElement.childNodes(0).childNodes(2).childNodes(3).attributes(0).Value</code></p>
<p>*******************</p>
<p>Then you can just response.write the values where you need them.</p>
<p>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.</p>
<p>You will also notice that I have &#8216;philadephia, pa&#8217; 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.</p>
<p>Also &#8216;conditionsicon&#8217; 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.</p>
]]></content:encoded>
			<wfw:commentRss>http://stephencollins.me/2009/07/google-xml-weather-feed-with-classic-asp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
