Ejemplo n.º 1
0
        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());
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            //Config.I.UseProxy = false;
            Config.I.UseProxy = true;

            DataInit.Init();

            //debug();
            //return;

            //var Account = Data.AirBnbAccounts.GetAccountByEmail("*****@*****.**");
            var account = AirBnbAccounts.GetAccountByEmail("*****@*****.**");
            var profile = SeleniumProxy.GetFirefoxProfileWithProxy(account.ProxyAddress);
            var driver  = SeleniumFactory.GetFirefoxDriver(profile);

            AirBnbLogin.Process(driver, account);

            var items = AirBnbScrapeReservation.GetAllReservationItems(driver);

            AirBnbScrapeReservation.GetFullReservationInfo(items[0], driver, account);

            driver.Quit();
        }