Free WordPress Weather Widget

wordpress-weather-widget

I’ve just released a free weather widget for WordPress.

While working on another of my sites, SucreLife.com, I wanted to display a weather widget to my users. Searching existing weather widgets failed to turn up anything which fit my requirements. The widgets I saw were either way too big, way too bloated, or came with a hefty price tag. What I really wanted was something fast, free and small. So I created my own.

About the Weather Widget

The widget shows the weather conditions for a city of your choice. It comes in a choice of two styles: the default wide style (260 x 58px), and the new square style (133 x 116px) suitable for narrower sidebars.¬†Despite its small size, it packs in a lot of info, showing both the current weather conditions and a three day forecast. Here’s how it looks:

weather-widgets

The widget gets its data from World Weather Online, so you need to register for one of their free API keys, available here.

All setup of the widget can be done via the simple admin panel, as shown:

weather widget admin panel

Installing the Weather Widget

To install the widget on your site, do the following:

  1. In your WordPress Admin area go to Plugins > Add New
  2. Search for “Weather Widget by Calcatraz”
  3. Click ‘Install Now’
  4. Click ‘Activate Plugin’
  5. Go to Appearance > Widgets
  6. Drag the ‘Weather Widget by Calcatraz’ box into the sidebar area
  7. Click on the ‘Weather Widget By Calcatraz’ to expand the options
  8. Fill out the required information (you can the API key for free here)
  9. Click ‘Save’

That’s it, the weather widget should now show up in your sidebar.

Note that you can also download the weather widget from the WordPress Plugin directory, if your prefer.

Questions, Etc.

Please feel free to discuss the widget in the comments below. I’ll be more than happy to answer any questions you have and will try my best to accommodate feature requests.

You can see the widget in action on SucreLife.com, in the sidebar.

Comments

  1. Your wordpress weather widget is awesome, beautiful and seems to works fine (I’m testing yet :p), but it shows fahrenheit temperature as default, it could have a configuration issue to change that for celsius as default, instead.

    Thank you and keep doing the great job! :D

  2. Dan says:

    Hi Fabio,

    Thanks for the kind comments! Just for you, I’ve just released a new version of the plugin which lets you select the scale used (Celsius, Fahrenheit or auto). The “auto” setting will show Fahrenheit to anyone whose browser language is US English and Celsius to everyone else.

    If the user changes the scale, their preference will be remembered for the duration of their session. As a result you may need to clear your own cookies in order to see your widget scale settings in action.

    Thanks again and let me know if there’s anything else I can help with.

    Cheers, Dan

  3. rcyrus says:

    I love the design of the widget! Will it automatically detect the location of my website visitor based on their location? Thanks!

  4. Dan says:

    Pleased to hear you like the design! At the moment the widget only shows the weather for a single location. I hoping to be able to add the option to show users the weather in their location soon.

    The main thing I have to figure out is if I can make this available to everyone – as at the moment adding such an option would cause anyone using a free worldweatheronline api key to quickly max out their monthly api call quota (meaning the widget would stop getting weather updates midway through the month). Hopefully I can find a way to avoid this.

    Thanks and all the best. Dan

  5. Chris says:

    Hi Dan
    Good work with your plugin. There is another WWO widget which may be helpful to you at http://wordpress.org/plugins/world-weather-wwo/. It caches the json data once an hour and lets you create as many instances of the widget as you like, enabling multiple locations. I think the widget may not be updated more but the coding is pretty solid.
    The plugin WP-Cloudy is also interesting work and takes a different approach where a weather post type is registered where you can add as many locations you like and then call them easily by means of shortcode, but unfortunately the Open Weather Map project which that plugin relies on no longer seems to be maintained.

  6. Dan says:

    Hi Chris,

    Thanks for taking the time to share the information on those plugins. I’ll definitely look into them. It sounds like the other WWO widget is taking a similar approach to my own – I too cache the data hourly. You can also create multiple instances of my weather widget and set them to different locations, but there are a couple of bugs which I’m working on which prevent the difference instances having different style settings, etc. Hopefully I’ll have these dealt with soon to make different instances completely independent. The free WWO api keys have a limit of 500 requests per day, so caching the data hourly for each location gives a limit of 20 locations that can be served by a single API key. Obviously the premium API keys don’t have that limit.

    I’ve also been planning to implement a shortcode a la WP-Cloudy to allow embedding of the weather widget in posts. Again I hope to have this done fairly soon.

    Thanks again for taking an interest and the time to comment. It’s really helpful to me to know how other widgets are tackling the various challenges. I appreciate it.

    Dan

Share your thoughts





Happily hosted by PowWeb