wp-weather

Latest version: 0.3.8
Please update to the latest version. I apologize for the rash of updates, but this version should fix all issues while allowing multiple forecasts to be used. Hopefully this will be the final update for quite some time.

Download link: http://wordpress.org/extend/plugins/wp-weather/

I have been using weather.com’s XML web service to display local weather information on my family website for several years. I decided to make the PHP code into a widget for wordpress. Here’s where you sign up for their service: http://www.weather.com/services/xmloap.html

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. Your location ID is a zip code for US and an alphanumeric code for international. Take Dublin for example – when searching for Dublin on weather.com you are taken to the following page: http://www.weather.com/weather/today/Dublin+Ireland+EIXX0014 and EIXX0014 is the location code.

Additionally, you may use a shortcode on any post or page.
[weather_display]
If you want to show different cities on different pages/posts you can specify a location id:
[weather_display location_id="75034"]
If you’d like to display more days than default (what you set in the plugin options page):
[weather_display forecast_length=5]

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.

Preview:

221 responses to “wp-weather”

  1. Noah

    matt, what am I doing wrong? The plugin is installed, obviously, with the Partner ID and License Key from weather.com. I’ve placed the widget on my sidebar and this is what the sidebar displays instead of the forecast:

    Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 1: parser error : Start tag expected, ‘<' not found in /home/content/h/i/c/hickoryridge1/html/wordpress/wp-content/plugins/wp-weather/wp-weather.php on line 254

    Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: HTTP/1.1 200 OK in /home/content/h/i/c/hickoryridge1/html/wordpress/wp-content/plugins/wp-weather/wp-weather.php on line 254

    Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in /home/content/h/i/c/hickoryridge1/html/wordpress/wp-content/plugins/wp-weather/wp-weather.php on line 254

    Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML'

  2. Noah

    Matt,
    You were right, I just waited the 30 minutes. Looks really good – - now to css to customize. Thanks and nice work.

  3. Matija

    Hi Matt –

    Thank you for the excellent work making this plugin, and maintaining it so that it works! Truly great.

    I’m wondering if there is any documentation on how to add / remove types of data (ie. high temp, low temp, etc..) in the widget?

  4. Matija

    ps. I realize Hi and Lo are already on there, but I meant stuff like P.O.P. (it’s for a golf course, so probability of precipitation is important :)

  5. Matija

    Matt – thanks for the very fast response.

    I just looked at the XML file, and it looks pretty straightforward. For example, adding:

    $xml->dayf->day->part->ppcp

    ..to the php file gives me precipitation as a number. I can format it myself. The only problem, of course, is if there are any updates to the plugin in the future (likely). Anyway, this is a good stopgap temporarily.

  6. Gerge

    Hello :)
    http://xoap.weather.com/weather/local/30339?cc=*&dayf=1&link=xoap&prod=xoap&
    Please:
    How to change en_US to fr_FR

    Thank you !

  7. Gerge

    please i mean that how i can have wp-weather in french

  8. Cynthia

    I’ve signed up with weather.com but it has been 6 hours and I’ve not received a message from them with the key and ID numbers. Does this plugin still work with their feed or are they just very slow to respond? We’re expecting a big snow storm here tonight and I’d like to get this up on a community blog.

  9. Arlindo Pinto

    Hi!
    I’ve translated the plugin to Portuguese, but cant make it work!
    Whats the secret?
    TX
    Merry Christmans!

  10. shoaib

    thnx a lot for such a nice plugin,m collecting cool things for my new design and this plugin is really cool .

  11. Csaba

    Hi,

    I use wp-weather, but I set only cities with ZIP like Frisco. I would like to set Pecs/pogany, Hungary but dosen’t work. Why?