public JObject GetWeatherForecast10DayJSON(Location location) { WebClient weatherWebClient = new WebClient(); string apiURL = String.Format("http://api.wunderground.com/api/8c1d3adae24c300f/forecast10day/q/{0}/{1}.json", location.State, location.City.Replace(" ", "_")); var weatherObject = weatherWebClient.DownloadString(apiURL); var weatherJSONObject = JObject.Parse(weatherObject); return weatherJSONObject; }
public JObject GetWeatherJSON(Location location) { WebClient weatherWebClient = new WebClient(); string apiURL = String.Format("https://api.forecast.io/forecast/fb51689a534b69ac23eb524d69ed3c5e/{0}, {1}", location.Latitude, location.Longitude); var weatherObject = weatherWebClient.DownloadString(apiURL); var weatherJSONObject = JObject.Parse(weatherObject); return weatherJSONObject; }