[Warning: This is a long post - but I think it's best to be thorough!]
I've put together a weather page for Theater View. It's HTML that's appropriate for a 10-foot display and looks like this:
The requirements to get this working for you: Download the appropriate WeatherFeed zip (as described below) and make sure you have the latest v11 beta.
Here's how it works... Weather.com publishes a Weather XML Data Feed which returns a real time forecast in XML. Using some javascript, I read variables from WeatherFeedParameters.xml to create the appropriate Data Feed request. I then retrieve the Data Feed and use XSLT to transform it into HTML appropriate for a 10-foot display.
Here's how to set it up... Unzip the file
http://pages.sbcglobal.net/scottraymond/WeatherFeedWithIconPack.zip to a directory of your choice. The majority of this zip is the icon pack of all the weather icons. You can get just the icon pack from
http://pages.sbcglobal.net/scottraymond/Weather.com%20Icon%20Pack.zip and you can get everything but the icon pack from
http://pages.sbcglobal.net/scottraymond/WeatherFeedWithoutIconPack.zipYou'll just need to adjust the WeatherFeedParameters.xml for your location and preferences.
The file can be edited with notepad and looks like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE WeatherFeedParameters [
<!ELEMENT DaysForecast (#PCDATA)>
<!ELEMENT Key (#PCDATA)>
<!ELEMENT LocID (#PCDATA)>
<!ELEMENT Par (#PCDATA)>
<!ELEMENT Units (#PCDATA)>
<!ELEMENT WeatherFeedParameters (LocID, DaysForecast, Par, Key, Units)>
]>
<WeatherFeedParameters>
<LocID>93933</LocID>
<DaysForecast>6</DaysForecast>
<Par>1005860981</Par>
<Key>110cf3973f6a4091</Key>
<Units>s</Units>
</WeatherFeedParameters>
You must only edit the contents of the <LocID>, <DaysForecast>, <Par>, <Key>, and <Units> elements. If you're in the U.S., just put your Zip Code into the <LocID> element. For anywhere else in the world, Weather.com has a search function to get the LocID for your XML feed. Use a URL similar to
http://xoap.weather.com/search/search?where=montreal and you'll see a return similar to
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--This document is intended only for use by authorized licensees of The Weather Channel. Unauthorized use is prohibited. Copyright 1995-2004, The Weather Channel Enterprises, Inc. All Rights Reserved.-->
<search ver="2.0">
<loc id="CAXX0301" type="1">Montreal, Canada</loc>
<loc id="USMO0602" type="1">Montreal, MO</loc>
<loc id="USWI0466" type="1">Montreal, WI</loc>
</search>
<DaysForecast> is simply how many days of extended forecast you want (the current day counts as one day, so 6 is really five future days). The <Par> and <Key> elements are given out by Weather.com. For now feel free to use my partner id and license key, but I'm not sure if Weather.com will balk after a while because of too many requests from too many different IPs. You can always get your own partner id and key for free by visiting
http://www.weather.com/services/xmloap.html. The <Units> element is "s" for standard and "m" for metric.
Now you just need to add a "Weather" button to the Theater View. Do this by choosing Configure Theater View (either from "Tools -> Options -> Tree & View -> Theater View" or right-click when in Theater View and choose "Configure Theater View") and then under "Items to Show" click on "Add" then choose "custom item". Choose webpage, call it whatever you want, and put in the complete path to the WeatherFeed.htm file you unzipped.
For this to work in IE, you need to have MSXML installed, which is done automatically by IE. If I've done this right, it shouldn't matter what version of IE you have, but perhaps I didn't do it right
You can be double sure by visiting the URL
http://www.bayes.co.uk/xml/index.xml?/xml/utils/msxml_sniffer.htm to see what's installed. You can download the latest MSXML from
http://msdn.microsoft.com/XML/XMLDownloads/default.aspx. I suggest you install the latest version (4.0) only if things aren't working right for you.
A problem you might run into with running "active" content in IE locally was addressed by AnalogRoaming:
Look in your IE options under Security for a setting to allow you to run active content from CDs and local disks. I don't have SP2 on this machine here but I did run into this at work on Friday and there is a setting similar to that that did fix our problem.
See here for more info.
http://www.phdcc.com/xpsp2.htm
Edit: The specific setting is at IE's Tools -> Internet Options -> Advanced tab and is called "Allow active content to run in files on My Computer". Oh... one last thing. I've tried my best to separate out the presentation of the HTML by using an external CSS (styles.css). You can edit styles.css and change the size and color of text pretty easily.
I may add a few more features:
- Finish the DTD to prevent users from entering unsuitable values in WeatherFeedParameters.xml.
- Finish debugging this for Firefox. For some reason, Sarissa is not working as it should.
edit: - Convert PNGs to JPG so that the "kludge" for getting around IE's inability to render transparent background doesn't cause a few anomolies which can require a browser refresh to get the image size right.A feature I wish someone would do for me:
- Restructure the HTML and css to work better for a given display resolution. Some have complained that the page is too long. The best way to fix this would probably be to set up the tables so that the row heights are fixed in pixels and the fonts are set in pixels instead of points. But CSS drives me crazy and I'm sick of it. Hopefully there's a webdesigner guru amongst us.
And, finally, if someone has a better idea for the HTML presentatation, I am willing to do two more XSLTs. So be the first to send me a template (be sure to use external CSS) and it'll get done.
Scott-