AccuWeather Extension
Vendor
MindTouch
Type Script
Categories Widget
Requires MindTouch Core 1.8.3 or later
Status Stable
License Free/Open Source
Manifest http://scripts.mindtouch.com/accuweather.xml

 

Install Script
To add  this script to your site, enter the address of your MindTouch installation (ex: http://www.mindtouch.com) and click the Add Script button.  This will open your control panel and prepopulate the necessary values.  You will still need to manually add configuration settings if required.  Note that no changes are made to your site until you confirm the action in your control panel.
Your site address:     


Table of Contents

Description

This extension contains functions for embedding AccuWeather widgets.

See also How to add a script, Using the Extension Dialog, Learn about DekiScript, Extensions Directory.


Functions

accuweather.weather(zipcode : str, celsius : bool) : xml

Embed the AccuWeather weather widget.

Parameters:

NameTypeDescription
zipcodestr(optional) Zipcode for location. (default: "92101")
celsiusbool(optional) Show temperature in degrees Celsius. (default: false)


Script Source

<extension>
  <title>AccuWeather Extension</title>
  <label>AccuWeather</label>
  <copyright>Copyright (c) 2006-2009 MindTouch Inc.</copyright>
  <description>This extension contains functions for embedding AccuWeather widgets.</description>
  <uri.help>http://developer.mindtouch.com/App_Catalog/AccuWeather</uri.help>
  <uri.logo>http://scripts.mindtouch.com/logos/accuweather-logo.png</uri.logo>
  <namespace>accuweather</namespace>
  
  <function>
    <name>weather</name>
    <description>Embed the AccuWeather weather widget.</description>
    <param name="zipcode" type="str" optional="true">Zipcode for location. (default: "92101")</param>
    <param name="celsius" type="bool" optional="true">Show temperature in degrees Celsius. (default: false)</param>
    <return>
      <html xmlns:eval="http://mindtouch.com/2007/dekiscript">
        <body>
          <div style='width: 300px; height: 250px; background-image: url( http://vortex.accuweather.com/adcbin/netweather_v2/backgrounds/blue_300x250_bg.jpg ); background-repeat: no-repeat; background-color: #346797;' >
            <div style='height: 238px;' >
              <script eval:src='"http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2.asp?partner=netweather&amp;tStyle=whteYell&amp;logo=0&amp;zipcode=" .. (args.zipcode ?? 92101) .. "&amp;lang=eng&amp;size=9&amp;theme=&amp;metric=" .. (args.celsius ? 1 : 0) .. "&amp;target=_self"'></script>
            </div>
            <div style='text-align: center; font-family: arial, helvetica, verdana, sans-serif; font-size: 11px; line-height: 12px; color: FFFFFF;' >
              <a style='color: #FFFFFF' href='http://www.accuweather.com/us/MA/CUMMINGTON/01026/city-weather-forecast.asp?partner=accuweather&amp;traveler=0' >Weather Forecast</a> | <a style='color: #FFFFFF' href='http://www.accuweather.com/maps-satellite.asp' >Weather Maps</a> | <a style='color: #FFFFFF' href='http://www.accuweather.com/index-radar.asp' >Weather Radar</a>
            </div>
          </div>
        </body>
      </html>
    </return>
  </function>
</extension>


Samples

  Output

To embed the AccuWeather widget:

{{ accuweather.weather("98052") }} 
./accuweather.png

 

Tag page (Edit tags)

Files 1

FileSizeDateAttached by 
accuweather.png
AccuWeather Logo
34.74 kB22:30, 30 Jan 2008SteveBActions
Viewing 10 of 10 comments: view all
Thx for adding the 'celsius' version. Someone should add a 'celsius' boolean argument that allows the scripts to be merged into a single XML file.
Posted 19:58, 5 Feb 2008
How is this going to work for locations outside US? As far as I can see the ZIP code will work only for US.
Thanks
Posted 14:35, 21 Feb 2008
Good question. It appears that AccuWeather only supports US locations. Maybe there is another widget with better international support? If so, let me know.
Posted 08:13, 22 Feb 2008
Hi thanks for the quick response.
AccuWeather seems to have international forecast as well. The link below will give weather forecast for London UK, maybe is just a matter of modifying the extension so it will work with it (just a suggestion as I don not know if this can be accomplished)
http://www.accuweather.com/world-index-forecast.asp?partner=ggfcast&traveler=0&loccode=EUR|UK|UK241|LONDON
Also the widget below looks good
http://www.yourminis.com/minis/yourminis/yourminis/mini:weather
Thanks edited 10:04, 22 Feb 2008
Posted 09:48, 22 Feb 2008
The AccuWeather has been updated so that you can stipulate Celsius and so that you can include cities outside of the US. To do so you would put the loccode found in the script in as the zip code. Example: if you want to have the AccuWeather for London it would look like this: {{ accuweather.weather("EUR|UK|UK241|LONDON") }}
Posted 23:08, 4 Mar 2008
I'm getting cities outside of the US working no problem but I can't get Celsius to work. I've been tried using Celsius or celsius the values 1, 0, true, false etc.

Any advice? Thanks for this great extension.
Posted 13:49, 13 Mar 2008
Try the following sample: {{ accuweather.weather("92101", true) }} Replace the zip code with your city
Posted 15:53, 13 Mar 2008
Also, make sure you use the latest version from http://scripts.mindtouch.com/accuweather.xml
Posted 21:20, 13 Mar 2008
I feel like an idiot for asking but I'm trying to add the Accuweather extension and it's asking for an SID (Service Identifier). I can't find any information on where to find this value - and I've been searching for a while. Suggestions? Thanks!
Posted 17:16, 5 Jun 2009
@napiweaser you should see an "Add Script" tab in your control. If you don't see that, I recommend that you upgrade your installation, because you're running a rather old version and it may not support all of the features required by this or other scripts.
Posted 00:08, 6 Jun 2009
Viewing 10 of 10 comments: view all
You must login to post a comment.