Re: Weather.com Plug-in
Posted: Fri Oct 14, 2011 6:06 pm
it would also give you rss and other media like photo's, movies, trailers etc
Home Automation for the Automation Enthusiast
https://housebot.com/forums/
I can read the XML - I know what it saying. But the NOAA forecast XML is not as straightforward as the weather.com was. The time series min/max temp values "move" based on time of day and I need to figure out the best way to deal with that. Here's an example. http://forecast.weather.gov/MapClick.ph ... tType=dwml Look at the 'layout keys' for the 7 day periods: 'k-p24h-n7-1' and 'k-p24h-n7-1'. Depending on time of day (forecast is updated several times per day), one or the other of those is anywhere from 6 to 8 points, resulting in the min and max daily temps "moving". That is, you can't always go to k-p24h-n7-1 and get the max day temps for example. But I'm early into this and maybe there's an easier way... I was waiting for weather.com to drop before I spent much time on replacing it.markd wrote:I'll parse if you toss me your XML fetch. . .
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <dwml version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.nws.noaa.gov/mdl/survey/pgb_survey/dev/DWMLgen/schema/DWML.xsd">
- <head>
- <product concise-name="dwmlByDay" operational-mode="developmental" srsName="WGS 1984">
<creation-date refresh-frequency="PT1H">2011-11-06T15:43:01-06:00</creation-date>
</product>
- <source>
<production-center>Dallas/Fort Worth, TX</production-center>
<credit>http://www.srh.noaa.gov/fwd</credit>
<more-information>http://www.nws.noaa.gov/forecasts/xml/</more-information>
</source>
</head>
- <data>
- <location>
<location-key>point1</location-key>
<description>Flower Mound TX, TX</description>
<point latitude="33.02" longitude="-97.1" />
<city state="TX">Flower Mound TX</city>
<height datum="mean sea level">600</height>
</location>
<moreWeatherInformation applicable-location="point1">http://forecast.weather.gov/MapClick.php?lat=33.02&lon=-97.1</moreWeatherInformation>
- <time-layout time-coordinate="local" summarization="12hourly">
<layout-key>k-p6h-n1-1</layout-key>
<start-valid-time>2011-11-06T21:19:00-06:00</start-valid-time>
<end-valid-time>2011-11-07T12:00:00-06:00</end-valid-time>
</time-layout>
- <time-layout time-coordinate="local" summarization="12hourly">
<layout-key>k-p6h-n1-2</layout-key>
<start-valid-time>2011-11-07T01:55:00-06:00</start-valid-time>
<end-valid-time>2011-11-07T04:00:00-06:00</end-valid-time>
</time-layout>
- <time-layout time-coordinate="local" summarization="12hourly">
<layout-key>k-p12h-n14-1</layout-key>
<start-valid-time period-name="Tonight">2011-11-06T18:00:00-06:00</start-valid-time>
<start-valid-time period-name="Monday">2011-11-07T06:00:00-06:00</start-valid-time>
<start-valid-time period-name="Monday Night">2011-11-07T18:00:00-06:00</start-valid-time>
<start-valid-time period-name="Tuesday">2011-11-08T06:00:00-06:00</start-valid-time>
<start-valid-time period-name="Tuesday Night">2011-11-08T18:00:00-06:00</start-valid-time>
<start-valid-time period-name="Wednesday">2011-11-09T06:00:00-06:00</start-valid-time>
<start-valid-time period-name="Wednesday Night">2011-11-09T18:00:00-06:00</start-valid-time>
<start-valid-time period-name="Thursday">2011-11-10T06:00:00-06:00</start-valid-time>
<start-valid-time period-name="Thursday Night">2011-11-10T18:00:00-06:00</start-valid-time>
<start-valid-time period-name="Veterans Day">2011-11-11T06:00:00-06:00</start-valid-time>
<start-valid-time period-name="Friday Night">2011-11-11T18:00:00-06:00</start-valid-time>
<start-valid-time period-name="Saturday">2011-11-12T06:00:00-06:00</start-valid-time>
<start-valid-time period-name="Saturday Night">2011-11-12T18:00:00-06:00</start-valid-time>
<start-valid-time period-name="Sunday">2011-11-13T06:00:00-06:00</start-valid-time>
</time-layout>
- <time-layout time-coordinate="local" summarization="12hourly">
<layout-key>k-p24h-n7-1</layout-key>
<start-valid-time period-name="Tonight">2011-11-06T18:00:00-06:00</start-valid-time>
<start-valid-time period-name="Monday Night">2011-11-07T18:00:00-06:00</start-valid-time>
<start-valid-time period-name="Tuesday Night">2011-11-08T18:00:00-06:00</start-valid-time>
<start-valid-time period-name="Wednesday Night">2011-11-09T18:00:00-06:00</start-valid-time>
<start-valid-time period-name="Thursday Night">2011-11-10T18:00:00-06:00</start-valid-time>
<start-valid-time period-name="Friday Night">2011-11-11T18:00:00-06:00</start-valid-time>
<start-valid-time period-name="Saturday Night">2011-11-12T18:00:00-06:00</start-valid-time>
</time-layout>
- <time-layout time-coordinate="local" summarization="12hourly">
<layout-key>k-p24h-n7-2</layout-key>
<start-valid-time period-name="Monday">2011-11-07T06:00:00-06:00</start-valid-time>
<start-valid-time period-name="Tuesday">2011-11-08T06:00:00-06:00</start-valid-time>
<start-valid-time period-name="Wednesday">2011-11-09T06:00:00-06:00</start-valid-time>
<start-valid-time period-name="Thursday">2011-11-10T06:00:00-06:00</start-valid-time>
<start-valid-time period-name="Veterans Day">2011-11-11T06:00:00-06:00</start-valid-time>
<start-valid-time period-name="Saturday">2011-11-12T06:00:00-06:00</start-valid-time>
<start-valid-time period-name="Sunday">2011-11-13T06:00:00-06:00</start-valid-time>
</time-layout>
- <parameters applicable-location="point1">
- <temperature type="minimum" units="Fahrenheit" time-layout="k-p24h-n7-1">
<name>Daily Minimum Temperature</name>
<value>64</value>
<value>63</value>
<value>45</value>
<value>40</value>
<value>38</value>
<value>49</value>
<value>55</value>
</temperature>
- <temperature type="maximum" units="Fahrenheit" time-layout="k-p24h-n7-2">
<name>Daily Maximum Temperature</name>
<value>75</value>
<value>73</value>
<value>58</value>
<value>60</value>
<value>67</value>
<value>70</value>
<value>74</value>
</temperature>
- <probability-of-precipitation type="12 hour" units="percent" time-layout="k-p12h-n14-1">
<name>12 Hourly Probability of Precipitation</name>
<value>60</value>
<value>60</value>
<value>80</value>
<value>80</value>
<value>10</value>
<value xsi:nil="true" />
<value xsi:nil="true" />
<value xsi:nil="true" />
<value xsi:nil="true" />
<value xsi:nil="true" />
<value xsi:nil="true" />
<value xsi:nil="true" />
<value xsi:nil="true" />
<value xsi:nil="true" />
</probability-of-precipitation>
- <weather time-layout="k-p12h-n14-1">
<name>Weather Type, Coverage, Intensity</name>
<weather-conditions weather-summary="Tstms Likely" />
<weather-conditions weather-summary="Severe Tstms" />
<weather-conditions weather-summary="Severe Tstms" />
<weather-conditions weather-summary="Tstms" />
<weather-conditions weather-summary="Slight Chc Tstms" />
<weather-conditions weather-summary="Sunny" />
<weather-conditions weather-summary="Clear" />
<weather-conditions weather-summary="Sunny" />
<weather-conditions weather-summary="Clear" />
<weather-conditions weather-summary="Sunny" />
<weather-conditions weather-summary="Partly Cloudy" />
<weather-conditions weather-summary="Cloudy" />
<weather-conditions weather-summary="Mostly Cloudy" />
<weather-conditions weather-summary="Mostly Cloudy" />
</weather>
- <conditions-icon type="forecast-NWS" time-layout="k-p12h-n14-1">
<name>Conditions Icon</name>
<icon-link>http://forecast.weather.gov/images/wtf/ntsra60.jpg</icon-link>
<icon-link>http://forecast.weather.gov/images/wtf/tsra60.jpg</icon-link>
<icon-link>http://forecast.weather.gov/images/wtf/ntsra80.jpg</icon-link>
<icon-link>http://forecast.weather.gov/images/wtf/scttsra80.jpg</icon-link>
<icon-link>http://forecast.weather.gov/images/wtf/hi_ntsra10.jpg</icon-link>
<icon-link>http://forecast.weather.gov/images/wtf/few.jpg</icon-link>
<icon-link>http://forecast.weather.gov/images/wtf/nskc.jpg</icon-link>
<icon-link>http://forecast.weather.gov/images/wtf/skc.jpg</icon-link>
<icon-link>http://forecast.weather.gov/images/wtf/nskc.jpg</icon-link>
<icon-link>http://forecast.weather.gov/images/wtf/skc.jpg</icon-link>
<icon-link>http://forecast.weather.gov/images/wtf/nsct.jpg</icon-link>
<icon-link>http://forecast.weather.gov/images/wtf/ovc.jpg</icon-link>
<icon-link>http://forecast.weather.gov/images/wtf/nbkn.jpg</icon-link>
<icon-link>http://forecast.weather.gov/images/wtf/bkn.jpg</icon-link>
</conditions-icon>
- <hazards time-layout="k-p6h-n1-1">
<name>Watches, Warnings, and Advisories</name>
- <hazard-conditions>
- <hazard headline="Hazardous Weather Outlook">
<hazardTextURL>http://forecast.weather.gov/showsigwx.php?warnzone=TXZ103&warncounty=TXC121&firewxzone=TXZ103&local_place1=Flower+Mound+TX&product1=Hazardous+Weather+Outlook</hazardTextURL>
</hazard>
</hazard-conditions>
</hazards>
- <hazards time-layout="k-p6h-n1-2">
<name>Watches, Warnings, and Advisories</name>
- <hazard-conditions>
- <hazard headline="Short Term Forecast">
<hazardTextURL>http://forecast.weather.gov/showsigwx.php?warnzone=TXZ103&warncounty=TXC121&firewxzone=TXZ103&local_place1=Flower+Mound+TX&product1=Short+Term+Forecast</hazardTextURL>
</hazard>
</hazard-conditions>
</hazards>
- <wordedForecast time-layout="k-p12h-n14-1" dataSource="fwdNetcdf" wordGenerator="markMitchell">
<name>Text Forecast</name>
<text>Showers and thunderstorms likely. Cloudy, with a low around 64. South wind around 15 mph, with gusts as high as 20 mph. Chance of precipitation is 60%.</text>
<text>Showers and thunderstorms likely, mainly after 1pm. Some of the storms could be severe. Mostly cloudy, with a high near 75. South southeast wind between 10 and 15 mph, with gusts as high as 20 mph. Chance of precipitation is 60%.</text>
<text>Showers and thunderstorms. Some of the storms could be severe. Low around 63. South southeast wind between 10 and 15 mph, with gusts as high as 20 mph. Chance of precipitation is 80%.</text>
<text>Showers and thunderstorms, mainly before 7am. High near 73. South wind 10 to 15 mph becoming west. Winds could gust as high as 25 mph. Chance of precipitation is 80%.</text>
<text>A 10 percent chance of showers and thunderstorms before 7pm. Partly cloudy, with a low around 45. Northwest wind between 10 and 15 mph, with gusts as high as 25 mph.</text>
<text>Sunny, with a high near 58. North northwest wind around 15 mph, with gusts as high as 25 mph.</text>
<text>Clear, with a low around 40. North northwest wind between 5 and 10 mph.</text>
<text>Sunny, with a high near 60. North northwest wind between 5 and 10 mph.</text>
<text>Clear, with a low around 38. Northwest wind around 5 mph.</text>
<text>Sunny, with a high near 67.</text>
<text>Partly cloudy, with a low around 49.</text>
<text>Cloudy, with a high near 70.</text>
<text>Mostly cloudy, with a low around 55.</text>
<text>Mostly cloudy, with a high near 74.</text>
</wordedForecast>
</parameters>
</data>
</dwml>
Code: Select all
http://forecast.weather.gov/MapClick.php?lat=33.02830&lon=-97.09270&FcstType=dwml