{"id":119,"date":"2008-12-10T00:00:14","date_gmt":"2008-12-10T07:00:14","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=319"},"modified":"2008-12-10T00:00:14","modified_gmt":"2008-12-10T07:00:14","slug":"yahoo-weather-rss","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=119","title":{"rendered":"Yahoo Weather RSS"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nvar temp:Number;\r\nvar weatherData:XML;\r\nvar yweather:Namespace;\r\n\r\nvar zipcode:String=&quot;11211&quot;;\r\nvar units:String = &quot;f&quot;;  \/\/ &quot;f&quot; or &quot;c&quot; for Fahrenheit or Celsius\r\n\r\nvar yahooURL:String = &quot;http:\/\/weather.yahooapis.com\/forecastrss?p=&quot; + zipcode + &quot;&amp;u=&quot; + units;\r\n\r\nvar yahooWeather:URLLoader = new URLLoader();\r\n\r\nyahooWeather.load(new URLRequest(yahooURL));\r\nyahooWeather.addEventListener(Event.COMPLETE, onLoaded);\r\n\r\nfunction onLoaded(evt:Event):void {\r\n\r\n\tweatherData=new XML(evt.target.data);\r\n\tyweather = weatherData.namespace(&quot;yweather&quot;);\r\n\t\r\n    temp = weatherData.channel.item.yweather::condition.@temp;\r\n\t \r\n\ttrace(temp);\r\n}\r\n<\/pre>\n<p>This snippet comes from a student question about how to get the temperature from yahoo weather. <\/p>\n<p>You could use this snippet to get lots of additional information based on a zipcode&#8230; like latitude, longitude, humidity, wind chill etc&#8230; The trickiest part of this code is the Namespace stuff&#8230; which I find generally annoying&#8230; probably just because I&#8217;m not used to it.<\/p>\n<p>You can read some detailed info about the content contained in the RSS file <a href=\"http:\/\/developer.yahoo.com\/weather\/#response\" \/>here.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>var temp:Number; var weatherData:XML; var yweather:Namespace; var zipcode:String=&quot;11211&quot;; var units:String = &quot;f&quot;; \/\/ &quot;f&quot; or &quot;c&quot; for Fahrenheit or Celsius var yahooURL:String = &quot;http:\/\/weather.yahooapis.com\/forecastrss?p=&quot; + zipcode + &quot;&amp;u=&quot; + units; var yahooWeather:URLLoader = new URLLoader(); yahooWeather.load(new URLRequest(yahooURL)); yahooWeather.addEventListener(Event.COMPLETE, onLoaded); function onLoaded(evt:Event):void { weatherData=new XML(evt.target.data); yweather = weatherData.namespace(&quot;yweather&quot;); temp = weatherData.channel.item.yweather::condition.@temp; trace(temp); } This snippet comes [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[88,34],"tags":[3,4,89,90,91,92,93],"class_list":["post-119","post","type-post","status-publish","format-standard","hentry","category-external-data","category-xml","tag-actionscript","tag-flash","tag-namespace","tag-rss","tag-weather","tag-xml","tag-yahoo"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=119"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/119\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}