Ejemplo n.º 1
0
        private static void CreateProtonMails()
        {
            while (true)
            {
                using (var browser = new BrowserChrome(/*proxy: Proxies.GetNext()*/ extensions: new string[] { "solver.crx" })) /// oszukane
                {
                    ConfigureSolver(browser.driver);
                    ProtonMailService service = new ProtonMailService(browser.driver);
                    //service.BeginRegister("John", "Kustosz", "karakaeumba222", "Buzupuzu2212", "*****@*****.**", "jolololo" );
                    //service.BeginRegister("Jurek", "Psirek", "psiurekjurek12321", "qweqwe123", "*****@*****.**");


                    //TemporaryEmailService emailService = new TemporaryEmailService(browser.driver);
                    //string email = emailService.GetEmail();

                    //browser.driver.OpenNewTab();
                    //ProtonMailService service = new ProtonMailService(browser.driver);
                    //service.BeginRegister("kowalskijan32123", "qweqweqwe123", email);
                    //browser.driver.SwitchTo().Window(browser.driver.WindowHandles.First());
                    //string activationCode = emailService.GetCode();
                    //browser.driver.Close();
                    //browser.driver.SwitchTo().Window(browser.driver.WindowHandles.First());

                    //service.FinishRegister(activationCode);
                }
            }
        }
Ejemplo n.º 2
0
        public static void Work()
        {
            foreach (var account in Accounts.AccountsList)
            {
                while (true)
                {
                    try
                    {
                        using (var browser = new BrowserChrome(proxy: Proxies.GetNext())) /// zlatwianie proxy
                        {
                            Logger.Log($"Rozpoczynam: {account.Login}");

                            NeoBuxService neoBux = new NeoBuxService(browser.driver);
                            browser.driver.Manage().Cookies.DeleteAllCookies();
                            neoBux.Login(account.Login, account.Pass);

                            Logger.Log($"Zalogowałem: {account.Login}");

                            neoBux.Work();
                            Console.ReadLine();
                        }
                    }
                    catch (WorkingException e) when(e.error == WorkingException.WorkingErrors.ThisProxyWasBefore)
                    {
                        Logger.Log("Proxy bylo wczesniej");
                        continue; /// jedziemy z kolejnym raz
                    }
                    //catch (Exception)
                    //{

                    //    throw;
                    //}
                    break;
                }
            }
        }
Ejemplo n.º 3
0
        static void wygrajMiss(int cnt)
        {
            var uzyte = File.ReadAllLines("../uzytemiss.txt")
                        .Select(a => a.Trim())
                        .Where(a => !string.IsNullOrEmpty(a))
                        .Distinct()
                        .ToList();
            var ipsy = File.ReadAllLines("../miss.txt")
                       .Select(a => a.Trim())
                       .Where(a => !string.IsNullOrEmpty(a) && !uzyte.Contains(a))
                       .Distinct()
                       .ToList();

            List <Task> zadania = new List <Task>();

            ipsy.ForEach(ip =>
            {
                File.AppendAllText("../uzytemiss.txt", ip + "\n");
                zadania.Add(Task.Factory.StartNew(() =>
                {
                    try
                    {
                        using (var browser = new BrowserChrome(proxy: ip, showImages: false, isWindow: false))
                        {
                            IWebDriver driver = browser.driver;

                            driver.Navigate().GoToUrl("http://thebestofpoland.eu/2019/03/19/glosowanie-final-miss-polonia-bielsko-biala-2019/");
                            WebDriverWait waiter = new WebDriverWait(driver, TimeSpan.FromSeconds(6));

                            Thread.Sleep(3000);
                            driver.IsPresentAndVisible(By.ClassName("boxzilla-close-icon"))?.Click();

                            var a = waiter.Until(ExpectedConditions.ElementIsVisible(By.Id("poll-answer-10")));
                            new Actions(driver).MoveToElement(a).Build().Perform();
                            Thread.Sleep(3000);
                            new Actions(driver).Click().Build().Perform();
                            var b = waiter.Until(ExpectedConditions.ElementIsVisible(By.Name("vote")));
                            new Actions(driver).MoveToElement(b).Click(b).Build().Perform();
                            WebDriverWait waiter2 = new WebDriverWait(new SystemClock(), driver, TimeSpan.FromSeconds(70000), TimeSpan.FromSeconds(3));
                            try
                            {
                                waiter2.Until(ExpectedConditions.ElementExists(By.XPath("//*[@id='polls-2-ans']/p[contains(text(), 'Total Voters')]")));
                                Console.WriteLine("Zagłosowano");
                            }
                            catch (Exception)
                            {
                                Console.WriteLine("Problem z wyswietleniem wynikow");
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine($"problem z: {ip}");
                        Console.WriteLine($"Error: {e.Message}");
                    }
                }));
                if (zadania.Count >= cnt)
                {
                    var t = Task.WaitAny(zadania.ToArray().ToArray());
                    zadania.RemoveAt(t);
                }
            });
            Task.WaitAll(zadania.ToArray().ToArray());
            Console.WriteLine("END");
            Console.ReadLine();
        }