You are not logged in Log in Join
You are here: Home » Members » djflux's Home » Overview - Plone WeatherReport Content Type » View Document

Log in
Name

Password

 

Overview - Plone WeatherReport Content Type

A product that allows you to display weather information in a Plone 1.x slot and also get more detailed weather information from a particular METAR station.

WeatherReport content type

Installing this type will allow one to display weather conditions for a particular METAR weather station in a Plone 1.x slot. The report view will also show all the current conditions at that station.

This product includes the incredible pymetar library. It is this library that provides all of the weather data to display. It is available for download at http://www.schwarzvogel.de/software-pymetar.shtml. Much thanks goes out to Tobias Klausmann as it provides the basis for this product.

Download

Grab WeatherReport here

Requirements

This product was developed and tested with the following software versions. It may work with other versions - YMMV:

  • Zope 2.7.0-b3
  • CMF-1.3.3
  • Plone-1.0.5
  • Archetypes 1.0.1

WeatherReport was originally designed for a corporate Intranet that was running the above software versions. That is the reason for such old versions. Feel free to try it on other versions and modify the code for Plone 2.x if I don't get around to it first.

Installation

Follow the instructions below to install the product in your Plone 1.x site:

  • Grab and install Archetypes in your Plone site (if haven't alredy done so)
  • Grab and install CMFQuickInstaller in your Plone site (if you haven't already)
  • Go to the portal_quickinstaller tool in your Plone site
  • Place a check mark next to WeatherReport and click the Install button

That's it. The product is installed. If you want the weatherslot to show up in your Portal you will need to add the following in your left or right slots configuration in your Portal Properties page:

here/weather_slot/macros/weatherBox

Usage

You should now have a WeatherReport content type available as an addable type when you want to add new content to your site. Included in WeatherRerport is a file called Locations.xml. This file is the same file that is included in the gweather applet from the GNOME project. It includes a lot (all?) of the METAR station ID's for North America, Europe, Asia, Australia, and the Middle East. You can search through this file for your city/state/country for the METAR code for your area. You can get the enture METAR code list in plain text at http://www.rap.ucar.edu/weather/surface/stations.txt

Eventually a list of available cities will be available as a drop-down list when you add a new WeatherReport that way you won't have to know the code. This feature will be in a future version of WeatherReport; once I learn how to parse the XML file in python :)

Add a WeatherReport to any folder in your Plone site and then input the information requested. Input the METAR code for your area in the METAR Station ID field of the edit form. Click save and then make sure that you change the state of the WeatherReport to published if you want it to show up in the weather slot.

You should now see the Title of the WeatherReport that you input as well as the current conditions and temperature at the METAR station that you input in the weather slot (if you've added the slot to your site properties).

In order for you to get a radar image map you must add your METAR station ID along with the radar map image code to the radar_map dictionary in Locations.py. For example, if you want to see the close up radar map for Sioux Falls, SD you would need to add the following code to radar_map and restart Zope:

'kfsd': fsd,

The fsd portion is the radar map code within the image URL at weather.com. Thanks to the GNOME guys for mapping all of these out (at least for the United States). Check Locations.xml for the radar map code associated with your METAR ID.

Right now if you do not update the radar_map dictionary, a generic weather map of the United States is displayed if your radar code is missing from radar_map in Locations.py. This dictionary will be automatically generated in a future version of this product so you won't have to manually update it.

BUGS

Currently the caching code isn't working as expected. Once the code grabs the weather information for a location it never gets invalidated. Im currently working on fixing this issue. It will be fixed in the next release.

TODO

Ahh the never ending saga of software wishlists. As my boss likes to say "can you add just one more thing?" Below is a list of things I'd like to do with the product if time permits.

  • Change icon in slot depending upon weather conditions
  • Add a portal_weather tool that lets one specify in which units to display weather (US or Metric)
  • A drop-down list of available METAR station ID's (maybe based on a continent or country specified in the portal_weather tool? :)
  • Cache the radar image so that weather.com doesn't get pissed.
  • Create a WeatherReport2 branch for Plone 2.x