Exemplo n.º 1
0
        public static string ExtractAPIResponse(OWMForecastObject forecast)
        {
            if (forecast == null)
            {
                return(String.Empty);
            }

            foreach (var list in forecast.list)
            {
                foreach (var weather in list.weather)
                {
                    if (weather.main.Contains("Rain"))
                    {
                        return(list.dt_txt);
                    }
                }
            }

            return(String.Empty);
        }
Exemplo n.º 2
0
        public static string WillItRain(string latitude, string longitude)
        {
            OWMForecastObject forecast = GetAPIResponse(latitude, longitude);

            return(ExtractAPIResponse(forecast));
        }