The Dark Sky API allows you to look up past, present, and future weather conditions for any point on the globe, and the DarkSky package for R aims to simplify such calls.
Install directly from GitHub with:
devtools::install_github('fascinatingfingers/DarkSky')
To connect to the API, you'll need to register and be issued a developer key; (see https://darksky.net/dev/register), and you'll also need to know the latitude and longitude of your location. You can save these secrets as session options as follows.
DarkSky::set_dark_sky_credentials(
key = '<Dark Sky secret key>',
lat = 42.3736,
lon = -71.1097
)
Once you've set your credentials, getting the forecast is as simple as...
weather <- DarkSky::get_forecast()
weather$currently
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.