Exemplo n.º 1
0
 public void GetConditionsAndForecastForLocationAsync()
 {
     //Get the weather forecast for the specified location
     WeatherResponse forecast = WUndergroundClient.GetConditionsAndForecastForLocationAsync(51.4800, 0.0).Result;
     var             v        = forecast.forecast.txt_forecast.forecastday[0].fcttext;
     //Debug.WriteLine(forecast.forecast.txt_forecast.forecastday[0].fcttext);
 }
Exemplo n.º 2
0
        public void GetConditionsForLocationAsync()
        {
            //Get the current weather conditions for the specified location
            WeatherResponse current = WUndergroundClient.GetConditionsForLocationAsync(51.4800, 0.0).Result;

            Assert.AreNotEqual(current.current_observation.feelslike_string.Length, 0);
        }
        static void Main(string[] args)
        {
            //Configure the client by setting the API Key. Get yours at http://www.wunderground.com
            WUnderground.Client.WUndergroundClient.Config.ApiKey = ConfigurationSettings.AppSettings["ApiKey"];

            //Get the current weather conditions for the specified location
            WeatherResponse current = WUndergroundClient.GetConditionsForLocationAsync(51.4800, 0.0).Result;

            Debug.WriteLine(current.current_observation.feelslike_string);

            //Get the weather forecast for the specified location
            WeatherResponse forecast = WUndergroundClient.GetConditionsAndForecastForLocationAsync(51.4800, 0.0).Result;

            Debug.WriteLine(forecast.forecast.txt_forecast.forecastday[0].fcttext);
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            //Configure the client by setting the API Key. Get yours at http://www.wunderground.com
            WUndergroundClient.Config.ApiKey     = Properties.Settings.Default.ApiKey;
            WUndergroundClient.Config.PROXY_HOST = Properties.Settings.Default.ProxyHost;
            WUndergroundClient.Config.PROXY_PASS = Properties.Settings.Default.ProxyPassword;
            WUndergroundClient.Config.PROXY_USER = Properties.Settings.Default.ProxyUsername;

            //Get the current weather conditions for the specified location
            WeatherResponse current = WUndergroundClient.GetConditionsForLocationAsync(51.4800, 0.0).Result;

            Debug.WriteLine(current.current_observation.feelslike_string);

            //Get the weather forecast for the specified location
            WeatherResponse forecast = WUndergroundClient.GetConditionsAndForecastForLocationAsync(51.4800, 0.0).Result;

            Debug.WriteLine(forecast.forecast.txt_forecast.forecastday[0].fcttext);

            //Get the weather forecast for the specified location
            Observation observation = WUndergroundClient.GetHistoricObservationForLocationAsync(new System.DateTime(2015, 12, 01, 12, 10, 10), 51.4800, 0.0).Result;

            Debug.WriteLine(observation.conds);
        }
Exemplo n.º 5
0
        public void GetConditionsForCityAsync()
        {
            WeatherResponse current_city = WUndergroundClient.GetConditionsForCityAsync("Utrecht", "NL").Result;

            Assert.AreEqual(current_city.current_observation.display_location.full, "Utrecht, Netherlands");
        }
Exemplo n.º 6
0
        public void GetConditionsForPwsIdAsync()
        {
            WeatherResponse current_city = WUndergroundClient.GetConditionsForPersonalWeatherStationAsync("IKOUDEKE10").Result;

            Assert.AreEqual("Vlissingen, Netherlands", current_city.current_observation.display_location.full);
        }