Goffstown NH Weather Forecast

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

Tonight
Patchy fog after midnight. Clear, with a low around 45. North wind 0 to 5 mph.

Monday Sep 20th
Patchy fog before 9am. Sunny, with a high near 72. East wind 0 to 5 mph.

Monday Night
Patchy fog after 4am. Mostly clear, with a low around 50. Southeast wind 0 to 5 mph.

Tuesday Sep 21st
Patchy fog before 8am. Sunny, with a high near 71. South wind 0 to 5 mph.

Tuesday Night
Mostly cloudy, with a low around 54. Southeast wind 0 to 5 mph.

Wednesday Sep 22nd
A slight chance of rain showers after 2pm. Mostly cloudy, with a high near 73.

Wednesday Night
A chance of rain showers. Mostly cloudy, with a low around 58. Chance of precipitation is 30%.

Thursday Sep 23rd
A chance of rain showers. Mostly cloudy, with a high near 73. Chance of precipitation is 50%.

Thursday Night
A chance of rain showers. Mostly cloudy, with a low around 57. Chance of precipitation is 50%.

Friday Sep 24th
A chance of rain showers. Mostly cloudy, with a high near 68. Chance of precipitation is 40%.

Friday Night
A chance of rain showers before 2am. Partly cloudy, with a low around 53. Chance of precipitation is 40%.

Saturday Sep 25th
A slight chance of rain showers after 2pm. Mostly sunny, with a high near 70.

Saturday Night
A chance of rain showers. Partly cloudy, with a low around 51. Chance of precipitation is 30%.

Published by

Kimball

Kimball is a website designer and developer in Goffstown, NH.

One comment on:
“Goffstown NH Weather Forecast”

Leave a Reply

Your email address will not be published. Required fields are marked *