public void SendWeatherForecast() { UserList userList = new UserList(); List <string> users = userList.getUsers(); WSResponce respObject = new WSResponce(); weatherdata response = new weatherdata(); response = respObject.WeatherForecastResponse(ForecastUrl); Console.WriteLine("Дата: с {0} по {1}", response.forecast[1].from, response.forecast[1].to); Console.WriteLine("Температура: {0}-{1}°С, осадки: {2}, облака: {3}", response.forecast[1].temperature.min, response.forecast[1].temperature.max, response.forecast[1].precipitation.type, response.forecast[1].clouds.value); //ComposeMessage newMessage = new ComposeMessage(); //string message = newMessage.CreateMessage(response); //ChromeOptions options = new ChromeOptions(); //options.AddArgument(cache); //driver = new ChromeDriver(options); //StartPage startPage = new StartPage(driver); //startPage.GoToUrl(); //foreach (string user in users) //{ // startPage.OpenChat(user); // startPage.SendMesage(message); //} //driver.Quit(); }
public void SendCurrentWeather() { UserList userList = new UserList(); List <string> users = userList.getUsers(); WSResponce respObject = new WSResponce(); current response = new current(); response = respObject.CurrentWeatherResponse(CurrentUrl); ComposeMessage newMessage = new ComposeMessage(); string message = newMessage.CreateMessage(response); ChromeOptions options = new ChromeOptions(); options.AddArgument(cache); driver = new ChromeDriver(options); StartPage startPage = new StartPage(driver); startPage.GoToUrl(); foreach (string user in users) { startPage.OpenChat(user); startPage.SendMesage(message); } driver.Quit(); }
static void Main(string[] args) { WSResponce respObject = new WSResponce(); string response = respObject.GetFormattedXml(CurrentUrl); Console.WriteLine(response); Console.WriteLine("__________________________"); ComposeMessage newMessage = new ComposeMessage(); MessageSending messageTemplate = new MessageSending(); messageTemplate.SendMessage(newMessage.CreateMessage(response)); Console.ReadLine(); }