public void GetNumOfDaysWithWeatherType(MainEnum weatherType, long cityId) { CityId = cityId; //Create Request GET(https://openweathermap.org/data/2.5/forecast/daily/?appid=b6907d289e10d714a6e88b30761fae22&id=2147714&units=metric) CreateRequest(); //Parse the response ParseForecastDailyResponse(); var daysList = WeatherAnalysys.GetDaysWithWeatherType(forecastDailyResponse, weatherType); //Optional logging to log... Console.WriteLine(string.Format("The number of days in {0} where the forecast is {1} in the next 2 weeks is: {2}", forecastDailyResponse.City.Name, EnumHelper.GetDescription(weatherType), daysList.Count)); LogDaysData(daysList); }
public void GetNumberOfDaysWithTempAboveCertainDegree(decimal minDegree, long cityId) { CityId = cityId; //Create Request GET (https://openweathermap.org/data/2.5/forecast/daily/?appid=b6907d289e10d714a6e88b30761fae22&id=2147714&units=metric) CreateRequest(); //Parse the response ParseForecastDailyResponse(); var daysList = WeatherAnalysys.GetDaysOverDegree(forecastDailyResponse, minDegree); //Optional logging to log... Console.WriteLine(string.Format("The number of days in {0} where the temperature is predicted to be above {1} degrees in the next 2 weeks is: {2}", forecastDailyResponse.City.Name, minDegree, daysList.Count)); LogDaysData(daysList); }