I built a WordPress plugin for displaying the weather forecast. The forecast data is pulled from the NOAA NWS Forecast API. The plugin has a shortcode that can be placed on a post, page, or in a widget, anywhere you want to show the forecast.
The shortcode takes two perimeters:
1) the location (as latitude, longitude), and
2) the number of days to show. Something like this [ weather location="43.0237,-71.6023" days="4" ]
The plug has a separate template file that can be customized to change the look of the forecast.
The plugin has built-in cache management. Caching prevents it from hit NOAA’s API every time the forecast is requested. If you hit the API too often NOAA may kick you off. The cache duration is configurable. A 6 hour cache works well for general use.
So here is the shortcode in action. It will grab NOAA’s 7 day forecast for my neighborhood (43.0237, -71.6023)
Goffstown, NH
This Afternoon Oct 10th
Sunny, with a high near 61. Northwest wind around 5 mph.
Tonight
Partly cloudy, with a low around 36. North wind 0 to 5 mph.
Sunday Oct 11th
Patchy frost before 8am, then a slight chance of rain showers. Mostly cloudy, with a high near 62. South wind 0 to 5 mph. Chance of precipitation is 20%.
Sunday Night
A chance of rain showers before 8pm, then rain between 8pm and 5am, then a chance of rain showers. Cloudy, with a low around 48. East wind 0 to 5 mph. Chance of precipitation is 100%.
Columbus Day Oct 12th
A chance of rain showers before 8am. Mostly sunny, with a high near 69. Northwest wind 0 to 5 mph. Chance of precipitation is 40%.
Monday Night
A chance of rain showers after 3am. Mostly cloudy, with a low around 47. Chance of precipitation is 30%.
Tuesday Oct 13th
A chance of rain showers. Mostly cloudy, with a high near 59. Chance of precipitation is 50%.
Tuesday Night
Rain showers likely before 8pm, then showers and thunderstorms. Mostly cloudy, with a low around 51. Chance of precipitation is 80%.
Wednesday Oct 14th
A chance of rain showers before 2pm. Partly sunny, with a high near 65. Chance of precipitation is 40%.
Wednesday Night
Partly cloudy, with a low around 44.
Thursday Oct 15th
Mostly sunny, with a high near 59.
Thursday Night
A slight chance of rain showers after 4am. Partly cloudy, with a low around 40.
Friday Oct 16th
A chance of rain showers. Partly sunny, with a high near 57. Chance of precipitation is 40%.
Hi
Hope your day is going well.
I was wondering if this plugin was available for download somewhere.
Thanks
Joe