Goffstown NH Weather Forecast

I built a WordPress plugin and shortcode that grabs weather forecast from the NWS’ new Forecast API. Using the shortcode I can place the forecast anywhere on a post, page, or in a widget. The short code take 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 for the look of the forecast. The plugin also manages it’s own cache, as to not hit NOAA’s API every time the forecast is requested. The cache duration is customization.

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
Partly cloudy, with a low around 8. West wind 0 to 5 mph.

Thursday Nov 14th
Mostly cloudy, with a high near 34. South wind 0 to 5 mph.

Thursday Night
Mostly cloudy, with a low around 26. Southwest wind 0 to 5 mph.

Friday Nov 15th
Sunny, with a high near 46. West wind 0 to 10 mph.

Friday Night
Partly cloudy, with a low around 18. Northwest wind 5 to 10 mph.

Saturday Nov 16th
Sunny, with a high near 33.

Saturday Night
Mostly clear, with a low around 15.

Sunday Nov 17th
Mostly sunny, with a high near 35.

Sunday Night
A chance of snow showers after 7pm. Mostly cloudy, with a low around 27. Chance of precipitation is 30%.

Monday Nov 18th
A chance of snow showers before 9am, then a chance of rain and snow showers. Partly sunny, with a high near 41. Chance of precipitation is 30%.

Monday Night
A chance of rain and snow showers. Mostly cloudy, with a low around 29. Chance of precipitation is 30%.

Tuesday Nov 19th
A slight chance of snow showers before 8am, then a slight chance of rain and snow showers. Mostly cloudy, with a high near 44.

Tuesday Night
A chance of rain showers before 3am, then a chance of rain and snow showers. Mostly cloudy, with a low around 31. Chance of precipitation is 30%.

Published by

Kimball

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

Leave a Reply

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