static void Main(string[] args) { Config.I.UseProxy = true; AirBnbAccounts.Load(); var map = AirBnbRoomMap.Load(); foreach (var airAccount in AirBnbAccounts.Accounts) { if (map.GetAccount(airAccount.Email) != null) { N.Note(airAccount.Email + " skiped"); continue; } for (var proxyNum = 0; proxyNum < 1; proxyNum++) { var email = airAccount.Email; N.Note("Processing account " + email + " with proxy " + airAccount.ProxyAddress[proxyNum]); var profile = SeleniumProxy.GetFirefoxProfileWithProxy(airAccount.ProxyAddress, proxyNum); var driver = SeleniumFactory.GetFirefoxDriver(profile); try { var signInSucceed = AirBnbLogin.Process(driver, airAccount); if (signInSucceed.Status == AirBnbLoginStatus.Failed) { N.Note("Password for " + email + " is wrong or account unreachable"); try { driver.Quit(); } catch { } break; } var item = AirBnbScrapeRooms.GetRoomList(driver, airAccount); map.List.Add(item); driver.Quit(); } catch (Exception e) { N.Note("Error " + airAccount.Email + " : " + e + "".Substring(0, 100) + "..."); driver.Quit(); } } } map.Save(); }
public static void ParseFolder(string Path) { var seasons = StreamlineSeasonGroup.Load(); var streamlineCollection = StreamlinePropertyCollection.Load(); var units = streamlineCollection.CreateIndex(); var map = new PriceMap(); var files = Temp.GetFileList(@"*.csv", Path); foreach (var file in files) { ProcessSourceFile(file, units, seasons, map); } CreatePriceScripts(map, units, seasons); var airbnbRooms = AirBnbRoomMap.Load(); PropertyMap.SetMap(airbnbRooms, streamlineCollection); CreateAirbnbNY022(map, airbnbRooms); }
static void Main(string[] args) { Console.WriteLine("Pricing sync for AirBnb"); Config.I.UseProxy = true; AirBnbAccounts.Load(); var roomsMap = AirBnbRoomMap.Load(); var streamlineCollection = StreamlinePropertyCollection.Load(); PropertyMap.SetMap(roomsMap, streamlineCollection); var property = PropertyMap.GetBySenstayID("LA029"); var proxyNum = 0; var airAccount = AirBnbAccounts.GetAccountByEmail(property.AirbnbAccountEmail); var email = airAccount.Email; N.Note("Processing account " + email + " with proxy " + airAccount.ProxyAddress[proxyNum]); var profile = SeleniumProxy.GetFirefoxProfileWithProxy(airAccount.ProxyAddress, proxyNum); using (var driver = SeleniumFactory.GetFirefoxDriver(profile)) { var signInSucceed = AirBnbLogin.Process(driver, airAccount); if (signInSucceed.Status != AirBnbLoginStatus.Sucess) { N.Note("Password for " + email + " is wrong or account unreachable"); try { driver.Quit(); } catch { // ignored } } AirBnbCalendar.SetPricesForUnit(driver, property, AirbnbUnitDailyPriceList.Load()); } }