Jump to content

Weather Network Link On Cache Pages


The Blue Quasar

Recommended Posts

I don't know who thought it up or did it first but including the "Local weather box - from The Weather Network" is such a useful thing.

 

Now a cacher that might be going out of territory for a caching adventure can see at a glance what the weather is doing... brilliant !

 

I wonder if it can be the whole day's forecast? That way if you leave in the morning you'd know what the afternoon holds in store.

 

Great idea though, local weather is very important when caching for families.

 

:) The Blue Quasar

Link to comment

I would like to credit Keith Watson for giving me the idea.

 

Mind you, although the weather network website purports to provide you with a means to get the code for the link I could never get that to work so had to delve my way through the javascript it produces to figure out how to set this up on my caches. Thanks Keith.

Link to comment

Alas, I am not sure where I gathered the idea to do it for the COG Spring Fling page, but I had my troubles let me tell you!

 

Originally I thought it would be easy to collect the cookie-cutter javascript that theweathernetwork.com provides, and simply add it to the cache page. However, it appears that Javascript code is not permitted on Cache pages (I can understand this). What I had to do was "Scrape" the actual Barrie image from the site simply by linking to the image they display on their site. I wasn't so sure it would work, but thankfully, everytime the cache page is loaded, it subsequently loads the most recent image that theweathernetwork.com is displaying at that time!

 

Because theweathernetwork.com breaks what appears to be one image into 3, I had to use code as follows:

 

<a href="http://www.theweathernetwork.com/weather/cities/can/pages/CAON0040.htm" target="_blank"><img src="http://www.theweathernetwork.com/inter/weathercentre/weatherbutton/images/headers/CAON0040.gif"><BR>

<img src="http://www.theweathernetwork.com/inter/weathercentre/weatherbutton/images/observations/YBN.gif"></a>

 

If that all seems tricky, feel free to email me and I will take the time to give you a better idea!

Link to comment

You will see from Swifteroo's example that you need to find the city code, such as CAON0040 in his example and the nearest airport code, in his case YBN. You can do these by going to theweathernetwork.com and getting a weather forecast for your nearest town. In my case when I get one for Stouffville it pops up at http://www.theweathernetwork.com/weather/c...es/CAON0656.htm and so I know my city code is CAON0656. I know my nearest airport/weaather reporting station is Buttonville for which the ICAO code is CYKZ so I take the last 3 characters YKZ which seems to be the convention that the weather network uses. Not all airport codes are supported however so you have to experiment.

 

Once I have all that I wrap it in a anchor tag to take you to the full forecast page and pop it in a table to put it on the right of the page and insert that code at the beginning of the cache long description. This results in code that looks like this:

 

<TABLE BORDER="0" ALIGN="right"><TR><TD>
<A HREF="http://www.theweathernetwork.com/weather/cities/can/pages/CAON0656.htm" TARGET="_blank">
<IMG SRC="http://www.theweathernetwork.com/inter/weathercentre/weatherbutton/images/headers/CAON0656.gif" BORDER="0"><BR>
<IMG SRC="http://www.theweathernetwork.com/inter/weathercentre/weatherbutton/images/observations/YKZ.gif" BORDER="0"><BR>
<IMG SRC="http://www.theweathernetwork.com/inter/weathercentre/weatherbutton/images/bottom.gif" BORDER="0"><BR></A>
</TD></TR></TABLE>

 

Don't forget to turn HTML on in your cache description <_<

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...