Polycom Digital Signage Administrator Guide | Data Source Tutorial |
|
|
General Settings
The general settings for the weather data source are straightforward. We tell Data Parser to refresh the feed every hour (i.e. 3600 seconds), to allow duplicate rows in the table, to fetch the feed from http://www.srh.noaa.gov/zipcity.php?inputstring=10005, and to store the parsed data in a table named Weather in the DataFeeds.mdb database:
<General>
<RefreshInterval>3600</RefreshInterval>
<AllowDuplicates>True</AllowDuplicates>
<Url>http://www.srh.noaa.gov/zipcity.php?inputstring=10005<
/Url>
<Database>DataFeeds.mdb</Database> <TableStructure Name="Weather">
<Field Type="Text">DayPart</Field>
<Field Type="Text">Condition</Field> <Field Type="Text">Temp</Field> <Field Type="Memo">ImageURL</Field> <Field Type="Memo">LocalImage</Field>
</TableStructure>
</General>
The Weather table we create has the following fields:
•DayPart: The part of the day that described by the weather data in the current row. For example, "Today" or "Friday Night".
•Condition: The weather conditions for the day part. For example, "Mostly Sunny" or "Partly Cloudy".
•Temp: The temperature for the day part.
•ImageURL: The URL of the image used on the web site to depict the weather for the day part.
•LocalImage: The path and file name of a local copy of the image. We'll download the image as we parse the web page.
•Building the Data Source Definition
Resolving the URL (e.g. by opening it in a browser and viewing the source) gives us the following raw HTML code. This code contains a lot of extraneous information. The part we're interested in is the "Forecast at a Glance" section, which is highlighted in below.
<!doctype html public
178 | Polycom, Inc. |