GoogleWeatherPlugin -- OBSOLETE, Replaced By WundergroundPlugin
Google has discontinued the API that this plugin relied upon.
Failures may show up as 'Unspecified error' for the topic text as the XML parser throws an unhandled exception.
Disable the plugin, then it should be possible to edit the topic and remove the %<nop>WEATHER% variable.
Provides weather forecast for a specified place.
Syntax Rules
%WEATHER{"5-digit-zip" options...}%
%WEATHER{"City, State" options...}%
%WEATHER{"City, Country" options...}%
Expands to the weather forecast obtained from Google's weather API for the specified place as a table.
The Google API is querried at most every 15 minutes for the same data to avoid exceeding Google's rate limit. Cached data is served between querries.
Options
Options are specified in the usual format -- each option is of the form
name="value'', where the quotes are required. multiple options are separated by spaces.
language
Specifies the language code to be supplied to google. See the Weather::Google documentation for the list of supported languages. Default is "en". The language code seems also to effect the units (SI or US), so it's more of a locale.
heading
Specifies whether or not to include the place name and forecast time before the table. Default is true.
tableattributes
Specifies a string to be passed to the %TABLE% directive of the
TablePlugin. May be used to customize the formatting of the table. Note that doublequotes must be escaped with a backslash.
tz
Specifies the timezone to be used to display the forecast time. Specify as a string acceptable to
DateTime::TimeZone, such as "US/Mountain". The timezone of the place and the timezone of the user are reasonable choices. The default is UTC.
timefmt
Specifies the display format for the forecast time. Specify as a string acceptable to
strftime. Default is "%a %d-%b-%Y %H %M %Z".
future
Specifies how many days beyond current conditions to forecast. 0 means the rest of today. 1 will include tomorrow. The maximum value is 4 (a Weather::Google limit).
Issues
- Although Google returns strings according to the
language parameter, text generated by the plugin does not.
- %WEATHER% can not be embedded in a TML table (work-around is to embed in an HTML table).
Examples
%WEATHER{"85003" tz="US/Mountain"}%
%WEATHER{"85003" tz="US/Mountain"}%
%WEATHER{"London, England" tableattributes="tableframe=\"border\"" future="0" tz="GMT"}%
%WEATHER{"London, England" tableattributes="tableframe=\"border\"" future="0" tz="GMT"}%
%WEATHER{"Paris, France" language="fr" tableattributes="databg=\"none\"" heading="1" future="4" tz="Europe/Paris"}%
%WEATHER{"Paris, France" language="fr" tableattributes="databg=\"none\"" heading="1" future="4" tz="Europe/Paris"}%
Plugin Settings
Plugin settings are stored as preferences variables. To reference a plugin setting write
%<plugin>_<setting>%, i.e.
%NEWPLUGIN_SHORTDESCRIPTION%
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Weather forecast from google
This plugin currently has no settings.
Plugin Installation Instructions
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.
- Download the ZIP file from the Plugin Home (see below)
- Unzip GoogleWeatherPlugin.zip in your twiki installation directory. Content:
| File: |
Description: |
data/TWiki/GoogleWeatherPlugin.txt |
Plugin topic |
data/TWiki/GoogleWeatherPlugin.txt,v |
Plugin topic repository |
lib/TWiki/Plugins/GoogleWeatherPlugin.pm |
Plugin Perl module |
- Configure the Plugin:
-
- TWiki 4.0 and up: Run the configure script to enable the Plugin
- Change the Plugin settings as needed
Plugin Info
Related Topics: TWikiPlugins,
DeveloperDocumentationCategory,
AdminDocumentationCategory,
TWikiPreferences
--
TWiki:Main.TimotheLitt
- 05 Jan 2010