Installation

Follow these steps to install this script on your wiki.

  1. Go to System Settings inside the Control Panel.
  2. Under Extensions, click Add Script.
  3. Enter a descriptive name for the extension
  4. Under Configuration add the following to the Manifest field: http://scripts.mindtouch.com/accuweather.xml
  5. Add extra configuration values as listed below under Configuration (If Configuration is not listed below, ignore this step.)
  6. Click on add script.

Related Links: DekiScript service, Extension Overview, DekiScript Overview, Extension Demos.


Overview

This extension contains functions for embedding AccuWeather widgets. This script requires MindTouch Deki 1.8.3 or later.

Functions:

  1. accuweather.weather

accuweather.weather(zipcode, celsius) : xml

Embed the AccuWeather weather widget.

Parameters:

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


Source Code

<extension>
  <title>AccuWeather Extension</title>
  <label>AccuWeather</label>
  <copyright>Copyright (c) 2007, 2008 MindTouch, Inc.</copyright>
  <description>This extension contains functions for embedding AccuWeather widgets.</description>
  <uri.help>http://wiki.developer.mindtouch.com/MindTouch_Deki/Extensions/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
Viewing 8 of 8 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
Viewing 8 of 8 comments: view all
You must login to post a comment.
Powered by MindTouch Deki v.8.08.1a