static void weatherBitCurrentWeatherAPI() { Out output = new Out(); WeatherBitController weatherBitController = new WeatherBitController(); output.outputToConsole("*** WeatherBit Current Weather ***"); string cityName = "Valletta"; output.outputToConsole($"Temperature {cityName}: {weatherBitController.getCurrentWeather(cityName)}"); }
static void weatherBitForecastAPI() { Out output = new Out(); WeatherBitController weatherBitController = new WeatherBitController(); output.outputToConsole("\n**** WeatherBit Forecast ****"); string cityName = "Valletta"; foreach (WeatherBitForecast forecast in weatherBitController.getWeatherForecast(cityName)) { output.outputToConsole($"{forecast.getDateTime().ToString()} Minimum: {forecast.getMinTemp()} Maximum: {forecast.getMaxTemp()}"); } }
static void weatherBitMapCurrentAPI() { Out output = new Out(); WeatherBitController weatherBitMapController = new WeatherBitController(); output.outputToConsole("**** WeatherBit Map Current Weather *****"); string cityName = "Valletta"; output.outputToConsole($"Temperature for {cityName}: {weatherBitMapController.getCurrentTemperature(cityName, EndpointType.CURRENT)}"); cityName = "London"; output.outputToConsole($"Temperature for {cityName}: {weatherBitMapController.getCurrentTemperature(cityName, EndpointType.CURRENT)}"); }
static void weatherBitForecastAPI() { Out output = new Out(); WeatherBitController weatherBitController = new WeatherBitController(); output.outputToConsole("*** WeatherBit Forecast ***"); string cityName = "Valletta"; output.outputToConsole($"*** Forecast for: {cityName} ***"); foreach (WeatherBitForecast forecast in weatherBitController.getForecastList(cityName)) { output.outputToConsole($"Date: {forecast.dateTime} Temperature: {forecast.temperature}"); } }
static void weatherBitMapForecastAPI() { Out output = new Out(); WeatherBitController weatherBitController = new WeatherBitController(); output.outputToConsole("**** WeatherBit Forecast *****"); string cityName = "Valletta"; output.outputToConsole($"Forecast weather for: {cityName}"); foreach (WeatherBitForecast forecast in weatherBitController.getForecastList(cityName, EndpointType.FORECAST)) { output.outputToConsole($"Date/Time: {forecast.dateTime.ToString("yyyy-MM-dd")} Min: {forecast.min_temp} Max: {forecast.max_temp}"); } weatherBitController.getForecastList(cityName, EndpointType.FORECAST); }
private static void WeatherbitAPI() { string cityName = "Valletta"; /*** WeatherBit ***/ /*** current weather ***/ WeatherBitController weatherBitController = new WeatherBitController(); AccuWeatherController accuWeatherControllerLocation = new AccuWeatherController(); Console.WriteLine("_____ WeatherBit _____"); Console.WriteLine("-_-_ Current Weather API _-_-"); Console.WriteLine($"Current Temperature for {cityName}: {weatherBitController.getCurrentWeather(cityName)}"); /*** Forcast ***/ Console.WriteLine($"Forecast for {cityName}: "); foreach (WeatherBitForcast forcast in weatherBitController.getForcast(cityName)) { Console.WriteLine($" Time {forcast.getDateTime()} Temprature: {forcast.getTemperature()}"); } }
private static void WeatherBitAPI() { string city = "California"; string countryCode = "US"; /**** WeatherBit ****/ /**** Current Weather ****/ WeatherBitController weatherBitController = new WeatherBitController(); Console.WriteLine("***** WeatherBit *****"); Console.WriteLine("***** Current Weather API *****"); Console.WriteLine($"Current Temperature for {city}, {countryCode}: {weatherBitController.getCurrentWeather(city, countryCode)}"); /**** FORECAST****/ Console.WriteLine("***** Forecast API *****"); Console.WriteLine($"Forecast for {city}, {countryCode}: "); foreach (WeatherBitForecast forecast in weatherBitController.getForecast(city, countryCode)) { Console.WriteLine($"{forecast.getDateTime().ToString()} Temp: {forecast.getTemperature()}"); } }