private void PollWalgreens(Location location) { using var walgreensClient = new WalgreensHttpClient(); var request = new WalgreensRequest() { ServiceId = "99", Position = new Position() { Latitude = location.Latitude, Longitude = location.Longitude }, AppointmentAvailability = new AppointmentAvailability() { StartDateTime = DateTime.Now.ToString("yyyy-MM-dd") }, Radius = Settings.StoreSearchRadius }; var result = walgreensClient.GetAvailabilityResponse(request); if (result.AppointmentsAvailable) { var msgBody = $"Go to this URL now and enter {result.ZipCode} in the search. "; msgBody += "https://www.walgreens.com/findcare/vaccination/covid-19/location-screening"; OnAvailabilityFound?.Invoke("Walgreens", location, msgBody); } }
private void PollGiant(Location location) { using var giantClient = new GiantHttpClient(); var result = giantClient.GetAvailabilityResponse(location.ZipCode); if (result.IndexOf("There are no locations with available appointments") == -1 && result.IndexOf("\r\n<!-- PharmScheduler.master -->\r\n<!DOCTYPE html>") == -1 && result.IndexOf("There are currently no COVID-19 vaccine appointments available") == -1) { var msgBody = $"Giant has vaccine appts available in {location.ZipCode}. Go to this URL now!"; msgBody += "https://giantsched.rxtouch.com/rbssched/program/covid19"; OnAvailabilityFound?.Invoke("Giant", location, msgBody); } }
private void PollCvs() { using var cvsClient = new CvsHttpClient(); var result = cvsClient.GetAvailabilityResponse(); foreach (var cityName in _cities) { if (result.ResponsePayloadData.Data.State.Single(d => d.City == cityName).TotalAvailable > 0) { var msgBody = $"CVS has vaccine appts available in {cityName}. Go to this URL now! "; msgBody += "https://www.cvs.com/immunizations/covid-19-vaccine?icid=cvs-home-hero1-link2-coronavirus-vaccine"; OnAvailabilityFound?.Invoke("CVS", new Location() { LocationName = "Pennsylvania" }, msgBody); } } }
private void PollRiteAid(Location location) { using var client = new RiteAidHttpClient(); pollCount = 0; var stores = client.GetStores(location); foreach (var store in stores) { var storeHasAvailability = client.GetAvailabilityResponse(store); pollCount++; if (storeHasAvailability) { var msgBody = $"RiteAid has vaccine appts at store #{store} near zip code {location.ZipCode} "; msgBody += "Go to this URL now! https://www.riteaid.com/pharmacy/apt-scheduler"; OnAvailabilityFound?.Invoke("RiteAid", location, msgBody); return; } Thread.Sleep(1000); } }