Esempio n. 1
0
        private string getCurrentWeather(string zipCode)
        {
            weatherAPICall weather = new weatherAPICall();

            if (weather == null)
            {
                return("clear");
            }

            WeatherObject weatherInfo = weather.getWeather(zipCode);

            if (weatherInfo == null)
            {
                return("clear");
            }

            return(weatherInfo.weather[0].main);
        }
Esempio n. 2
0
        private int getCurrentTemp(string zipCode)
        {
            weatherAPICall weather = new weatherAPICall();

            if (weather == null)
            {
                return(50);
            }

            WeatherObject weatherInfo = weather.getWeather(zipCode);

            if (weatherInfo == null)
            {
                return(50);
            }

            float kelvinTemp = weatherInfo.main.temp;
            int   temp       = (int)((kelvinTemp - 273.15) * 1.8 + 32);

            return(temp);
        }