Ejemplo n.º 1
0
        static void darkSkyCurrentAPI()
        {
            Out output = new Out();

            DarkSkyController darkSkyController = new DarkSkyController();

            output.outputToConsole("***** DarkSky Current Weather *****");

            string cityName           = "Valletta";
            DarkSkyForecastModel dsfm = darkSkyController.getForecast(cityName, EndpointType.FORECAST);

            output.outputToConsole($"Current Temp in {cityName} is {dsfm.currently.temperature}");
        }
Ejemplo n.º 2
0
        static void darkSkyForecastAPI()
        {
            Out output = new Out();

            DarkSkyController darkSkyController = new DarkSkyController();

            output.outputToConsole("\n**** DarkSky Forecast ****");

            AccuWeatherController accuWeatherController = new AccuWeatherController();

            string position = accuWeatherController.getLocationGeoPosition("Valletta");

            foreach (DarkSkyForecast forecast in darkSkyController.getForecast(position))
            {
                output.outputToConsole($"Timezone {forecast.getTimezone()} Date: {forecast.getDateTime()} Minimum: {forecast.getMinTemp()} Maximum: {forecast.getMaxTemp()}");
            }
        }
Ejemplo n.º 3
0
        static void darkSkyForecastAPI()
        {
            Out output = new Out();

            DarkSkyController darkSkyController = new DarkSkyController();

            output.outputToConsole("***** DarkSky Forecast *****");

            string cityName           = "Valletta";
            DarkSkyForecastModel dsfm = darkSkyController.getForecast(cityName, EndpointType.FORECAST);

            foreach (ForecastDay fd in dsfm.daily.data)
            {
                DateTime dateTime = DateTimeOffset.FromUnixTimeSeconds(fd.time).UtcDateTime;
                output.outputToConsole($"{dateTime} Minimum: {fd.temperatureMin} Maximum: {fd.temperatureMax}");
            }
        }
Ejemplo n.º 4
0
        private static void DarkSkyAPI()
        {
            string cityName = "Valletta";

            DarkSkyController darkSkyController = new DarkSkyController();

            Console.WriteLine("**** DarkSky ****");
            Console.WriteLine("**** Current Weather API ****");
            Console.WriteLine($"Current Temperature for {cityName}: {darkSkyController.getCurrentWeather(cityName)}");

            /**** FORECAST****/
            Console.WriteLine("***** Forecast API *****");
            Console.WriteLine($"Forecast for {cityName}: ");
            foreach (DarkSkyForecast forecast in darkSkyController.getForecast(cityName))
            {
                Console.WriteLine($"{forecast.getDateTime().ToString()} Minimum: {forecast.getMinimum()} Maximum: {forecast.getMaximum()}");
            }
        }
        private static void DarkSkyAPI()
        {
            string city = "Valletta";

            /**** DarkSky ****/
            /**** Current Weather ****/
            DarkSkyController darkSkyController = new DarkSkyController();

            Console.WriteLine("***** DarkSky *****");
            Console.WriteLine("***** Current Weather API *****");
            Console.WriteLine($"Current Temperature for {city}: {darkSkyController.getCurrentWeather(city)}");

            /**** FORECAST****/
            Console.WriteLine("***** Forecast API *****");
            Console.WriteLine($"Forecast for {city}: ");
            foreach (DarkSkyForecast forecast in darkSkyController.getForecast(city))
            {
                Console.WriteLine($"{forecast.getDateTime().ToString()} Temp-High: {forecast.getTemperatureHigh()} Temp-Low: {forecast.getTemperatureLow()}");
            }
        }