Dark Sky is an iOS app and website that provides “hyperlocal” weather forecasts. They make their data available to third parties via a web API which we will be using to create a simple shiny app.

In order to access this API you need an account - if you go to https://darksky.net/dev/ you can sign up to gain access to their API. Once you have registered you will have access to a usage console that includes a unique secret key (the long alphanumeric string at the bottom of the page) you will use this to access the API. You can make up to 1000 API requests per day without incurring any cost, so there is no need to enter any billing information.

Documentation for the Dark Sky API can be found here and includes all information about how to create a properly formated API request and the details of the JSON format of the returned data.


Task 1 - Getting data from Dark Sky

Your first task is to write a single function that accepts an API key, latitude, longitude, and optionally a date and returns a data frame containing the hourly forecast for the given location (and time). The Dark Sky forecast API provides a number of different weather related predictions - all of these quantities should be returned by your function along with a properly formated datetime column. You do not need to return any of the currently, minutely, daily or other data - only hourly data is required. Note that you can exclude some of these results via your API request.

Some additional requirements:


Task 2 - Prediction Locations

Your second task is to scrap US city location information from the following Wikipedia page: https://en.wikipedia.org/wiki/List_of_United_States_cities_by_population. The entire table should be read into R via web scraping (think rvest).

Your final data frame should meet the following requirements


Task 3 - Shiny Predictions

Your third task is to create a shiny app that provides a GUI interface for the get_darksky function you wrote earlier. This app should allow the user to select a city from a list and provide a visualization of the hourly weather forecast for that location.

Your app should have the following features: