Updated: 2008-0815

weather.com has made changes to their servers which now REQUIRE you to enter a partner id and license key in this plugin's settings. If you do not, they will not send the complete forecast data which in turn will break this plugin.

I have been using weather.com's XML web service to display local weather information on my family website for several years. Today I decided to make the PHP code into a widget for wordpress.

This widget uses a database table to cache the data for a half hour to avoid hammering the web service. Additionally, if you are using the wp-cache plugin, any changes to the options clear the cache.

To install: upload to your plugin directory, activate the plugin, set the options and add the widget to your sidebar.

This version now supports PHP4.

If you have questions, leave a comment or contact me.

Preview:

wp-weather widget(1.7 MB MD5:8e6ad621ecb3f946945c450066a3242e)
Downloads: 7879 times

Update: This plugin is now in the Subversion Repository.

http://svn.wp-plugins.org/wp-weather/trunk

Update: The plugin can be placed anywhere in your template with a simple call to the display function (assuming you have configured the basic options in the admin):

PHP:
  1. <?php
  2.     weather_display();
  3. ?>

I have changed the plugin to use the snoopy class provided by wordpress for retrieving the xml data. This should get around the fopen issues with some hosts.