コード例 #1
0
        public void LoginHttpHelper()
        {
            string str           = string.Empty;
            string accountUser   = string.Empty;
            string accountPass   = string.Empty;
            string proxyAddress  = string.Empty;
            string proxyPort     = string.Empty;
            string proxyUserName = string.Empty;
            string proxyPassword = string.Empty;
            string Url           = string.Empty;

            Url = "https://www.linkedin.com/";
            ////string pageSrcLogin = HttpChilkat.GetHtmlProxy(Url, proxyAddress, proxyPort, proxyUserName, proxyPassword);
            string pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), proxyAddress, int.Parse(proxyPort), proxyUserName, proxyPassword);


            string postdata    = string.Empty;
            string postUrl     = string.Empty;
            string ResLogin    = string.Empty;
            string csrfToken   = string.Empty;
            string sourceAlias = string.Empty;

            if (pageSrcLogin.Contains("csrfToken"))
            {
                csrfToken = pageSrcLogin.Substring(pageSrcLogin.IndexOf("csrfToken"), 100);
                string[] Arr = csrfToken.Split('"');
                csrfToken = Arr[2];
            }

            if (pageSrcLogin.Contains("sourceAlias"))
            {
                sourceAlias = pageSrcLogin.Substring(pageSrcLogin.IndexOf("sourceAlias"), 100);
                string[] Arr = sourceAlias.Split('"');
                sourceAlias = Arr[2];
            }
            accountUser = "******";
            accountUser = accountUser.Replace("@", "%40");
            accountPass = "******";
            postUrl     = "https://www.linkedin.com/uas/login-submit";
            postdata    = "session_key=" + accountUser + "&session_password="******"&source_app=&trk=guest_home_login&session_redirect=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;

            ResLogin = HttpHelper.postFormData(new Uri(postUrl), postdata);

            Url          = "http://www.linkedin.com/home?trk=hb_tab_home_top";
            pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), proxyAddress, int.Parse(proxyPort), proxyUserName, proxyPassword);

            LogoutHttpHelper(ref HttpHelper);

            Url          = "http://www.linkedin.com/home?trk=hb_tab_home_top";
            pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), proxyAddress, int.Parse(proxyPort), proxyUserName, proxyPassword);
        }
コード例 #2
0
        //New method added by Lijo John 16/10/2014
        public bool CheckProxy(string IPAddress, int Port, string Username, string Password, string URL)
        {
            GlobusHttpHelper objGlobusHttpHelper = new GlobusHttpHelper();
            bool             status = false;

            try
            {
                System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();
                string ResponseTime = string.Empty;
                timer.Start();
                string Response = objGlobusHttpHelper.getHtmlfromUrlProxy(new Uri(URL), IPAddress, Port, Username, Password);
                timer.Stop();
                TimeSpan timeTaken = timer.Elapsed;
                ResponseTime = timeTaken.ToString();

                if (string.IsNullOrEmpty(Response))
                {
                    timeTaken = new TimeSpan();
                    timer.Start();
                    Response = objGlobusHttpHelper.getHtmlfromUrlProxy(new Uri(URL), IPAddress, Port, Username, Password);
                    timer.Stop();
                    timeTaken    = timer.Elapsed;
                    ResponseTime = timeTaken.ToString();
                }
                if (!string.IsNullOrEmpty(Response) && !Response.Contains("Internet Explorer cannot display the webpage"))
                {
                    status = true;
                }
                else
                {
                    status = false;
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(ex.StackTrace);
            }
            return(status);
        }
コード例 #3
0
ファイル: AccountManager.cs プロジェクト: shah8701/faceboard
        /// <summary>
        /// Returns Captcha Image from Facebook
        /// </summary>
        /// <param name="responseMessage"></param>
        /// <returns></returns>
        public void GetCaptchaImageMultiModified(string email, ref GlobusHttpHelper HttpHelper, ref string post_form_id, ref string lsd,
           ref string reg_instance,
           ref string firstname,
           ref string lastname,
           ref string reg_email__,
           ref string reg_email_confirmation__,
           ref string reg_passwd__,
           ref string sex,
           ref string birthday_month,
           ref string birthday_day,
           ref string birthday_year,
           ref string captcha_persist_data,
           ref string captcha_session,
           ref string extra_challenge_params,
           ref string recaptcha_public_key,
           ref string authp_pisg_nonce_tt,
           ref string authp,
           ref string psig,
           ref string nonce,
           ref string tt,
           ref string time,
           ref string challenge,
           ref string CaptchaSummit, ref string DOB, List<string> listFirstName, List<string> listLastName, string SexSelect)
        {

            try
            {
                string proxyAddress = string.Empty;
                string proxyPort = string.Empty;
                string proxyUsername = string.Empty;
                string proxyPassword = string.Empty;

                string FirstName = string.Empty;
                string LastName = string.Empty;
                string Email = string.Empty;
                string Password = string.Empty;
                //string DOB = string.Empty;

                Email = email.Split(':')[0];
                Password = email.Split(':')[1];

                if (email.Split(':').Length > 5)
                {
                    proxyAddress = email.Split(':')[2];
                    proxyPort = email.Split(':')[3];
                    proxyUsername = email.Split(':')[4];
                    proxyPassword = email.Split(':')[5];
                    //AddToListBox("Setting proxy " + proxyAddress + ":" + proxyPort);
                }
                else if (email.Split(':').Length == 4)
                {
                    //MessageBox.Show("Private proxies not loaded with emails \n Accounts will be created with public proxies");
                    proxyAddress = email.Split(':')[2];
                    proxyPort = email.Split(':')[3];
                }

                FirstName = firstname;
                LastName = lastname;

                {
                    #region Random First & Last Names
                    if (listFirstName.Count > 0)
                    {
                        try
                        {
                            FirstName = listFirstName[Utils.GenerateRandom(0, listFirstName.Count)];
                        }
                        catch (Exception ex)
                        {
                            FirstName = string.Empty;
                        }
                    }
                    if (listLastName.Count > 0)
                    {
                        try
                        {
                            LastName = listLastName[Utils.GenerateRandom(0, listLastName.Count)];
                        }
                        catch (Exception ex)
                        {
                            LastName = string.Empty;
                        }
                    }
                    #endregion
                }

                #region Get Params


                int intProxyPort = 80;
                Regex IdCheck = new Regex("^[0-9]*$");

                if (Utils.IsNumeric(proxyPort))
                {
                    intProxyPort = int.Parse(proxyPort);
                }


                string pageSource = HttpHelper.getHtmlfromUrlProxy(new Uri("http://www.facebook.com/"), proxyAddress, intProxyPort, proxyUsername, proxyPassword);


                #region CSS, JS, & Pixel requests to avoid Socket Detection

                ///JS, CSS, Image Requests
                //RequestsJSCSSIMG.RequestJSCSSIMG(pageSource, ref HttpHelper);


                ///Pixel request
                string reg_instanceValue = FBUtils.GetParamValue(pageSource, "reg_instance");
                //string asyncSignal = Utils.GenerateRandom(3000, 4000).ToString();
                string asyncSignal = string.Empty;
                try
                {
                    asyncSignal = Utils.GenerateRandom(3000, 8000).ToString();
                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);

                }
                string pixel = HttpHelper.getHtmlfromUrl(new Uri("http://pixel.facebook.com/ajax/register/logging.php?action=form_focus&reg_instance=" + reg_instanceValue + "&asyncSignal=" + asyncSignal + "&__user=0"));
                #endregion

                if (pageSource.Contains("post_form_id"))
                {
                    try
                    {
                        string post_id = pageSource.Substring(pageSource.IndexOf("post_form_id"), 200);
                        string[] Arr1 = post_id.Split('"');
                        post_form_id = Arr1[2];
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);

                    }
                }
                if (pageSource.Contains("lsd"))
                {
                    try
                    {
                        string lsd_val = pageSource.Substring(pageSource.IndexOf("lsd"), 100);
                        string[] Arr_lsd = lsd_val.Split('"');
                        lsd = Arr_lsd[2];
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);

                    }
                }
                if (pageSource.Contains("reg_instance"))
                {
                    try
                    {
                        string reg_instance_val = pageSource.Substring(pageSource.IndexOf("reg_instance"), 200);
                        string[] Arr_reg = reg_instance_val.Split('"');
                        reg_instance = Arr_reg[4];
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);

                    }
                }
                firstname = FirstName.Replace(" ", "%20");
                lastname = LastName.Replace(" ", "%20");
                reg_email__ = Email.Replace("@", "%40");
                reg_email_confirmation__ = Email.Replace("@", "%40");
                //reg_passwd__ = Password.Replace("@", "%40");
                reg_passwd__ = Uri.EscapeDataString(Password);//.Replace("@", "%40");
                sex = SexSelect;
                birthday_month = Utils.GenerateRandom(1, 12).ToString();
                birthday_day = Utils.GenerateRandom(1, 28).ToString();
                birthday_year = Utils.GenerateRandom(1980, 1990).ToString();
                DOB = birthday_day + ":" + birthday_month + ":" + birthday_year;

                if (pageSource.Contains("captcha_persist_data"))
                {
                    try
                    {
                        string captcha_persist_data_val = pageSource.Substring(pageSource.IndexOf("captcha_persist_data"), 500);
                        string[] Arr_captcha_persist_data_val = captcha_persist_data_val.Split('"');
                        captcha_persist_data = Arr_captcha_persist_data_val[4];
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);

                    }
                }
                if (pageSource.Contains("captcha_session"))
                {
                    try
                    {
                        string captcha_session_val = pageSource.Substring(pageSource.IndexOf("captcha_session"), 200);
                        string[] Arr_captcha_session_val = captcha_session_val.Split('"');
                        captcha_session = Arr_captcha_session_val[4];
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);

                    }
                }
                if (pageSource.Contains("extra_challenge_params"))
                {
                    try
                    {
                        string extra_challenge_params_val = pageSource.Substring(pageSource.IndexOf("extra_challenge_params"), 500);
                        string[] Arr_extra_challenge_params_val = extra_challenge_params_val.Split('"');
                        authp_pisg_nonce_tt = Arr_extra_challenge_params_val[4];
                        extra_challenge_params = Arr_extra_challenge_params_val[4];
                        extra_challenge_params = extra_challenge_params.Replace("=", "%3D");
                        extra_challenge_params = extra_challenge_params.Replace("&amp;", "%26");
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);

                    }
                }


                #endregion


            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }
コード例 #4
0
        public void SignupMultiThreaded(object parameters)
        {
            Array paramsArray = new object[3];

            paramsArray = (Array)parameters;

            string Email    = string.Empty;
            string Password = string.Empty;

            string proxyAddress  = string.Empty;
            string proxyPort     = string.Empty;
            string proxyUsername = string.Empty;
            string proxyPassword = string.Empty;

            string emailData = (string)paramsArray.GetValue(0);
            string username  = (string)paramsArray.GetValue(1);
            string name      = (string)paramsArray.GetValue(2);

            try
            {
                Email    = emailData.Split(':')[0];
                Password = emailData.Split(':')[1];
            }
            catch (Exception ex) { AddToListBox(ex.Message); }

            if (emailData.Split(':').Length > 5)
            {
                proxyAddress  = emailData.Split(':')[2];
                proxyPort     = emailData.Split(':')[3];
                proxyUsername = emailData.Split(':')[4];
                proxyPassword = emailData.Split(':')[5];
            }
            else if (emailData.Split(':').Length == 4)
            {
                proxyAddress = emailData.Split(':')[2];
                proxyPort    = emailData.Split(':')[3];
            }

            try
            {
                if (!(username.Count() < 15 || Password.Count() > 6))
                {
                    if (username.Count() > 15)
                    {
                        AddToListBox("Username Must Not be greater than 15 char");
                    }
                    else if (Password.Count() < 6)
                    {
                        AddToListBox("Password Must Not be less than 6 char");
                    }
                }
            }
            catch { }

            Random randm     = new Random();
            double cachestop = randm.NextDouble();

            string textUrl     = globusHelper.getHtmlfromUrlProxy(new Uri("https://twitter.com/signup"), proxyAddress, proxyPort, proxyUsername, proxyPassword, "", "");
            string pagesource1 = globusHelper.getHtmlfromUrl(new Uri("https://www.google.com/recaptcha/api/js/recaptcha_ajax.js"), "", "");
            string pagesource2 = globusHelper.getHtmlfromUrl(new Uri("https://www.google.com/recaptcha/api/challenge?k=6LfbTAAAAAAAAE0hk8Vnfd1THHnn9lJuow6fgulO&ajax=1&cachestop=" + cachestop + "&lang=en"), "", "");

            try
            {
                int    IndexStart = pagesource2.IndexOf("challenge :");
                string Start      = pagesource2.Substring(IndexStart);
                int    IndexEnd   = Start.IndexOf("',");
                string End        = Start.Substring(0, IndexEnd).Replace("challenge :", "").Replace("'", "").Replace(" ", "");
                capcthavalue = End;
                ImageURL     = "https://www.google.com/recaptcha/api/image?c=" + End;
            }
            catch (Exception ex)
            {
                Console.WriteLine("1 :" + ex.StackTrace);
            }

            WebClient webclient = new WebClient();

            webclient.DownloadFile(ImageURL, Application.LocalUserAppDataPath + "\\Image.jpg");

            try
            {
                int    StartIndex = textUrl.IndexOf("phx-signup-form");
                string Start      = textUrl.Substring(StartIndex);
                int    EndIndex   = Start.IndexOf("name=\"authenticity_token");
                string End        = Start.Substring(0, EndIndex).Replace("phx-signup-form", "").Replace("method=\"POST\"", "").Replace("action=\"https://twitter.com/account/create\"", "");
                authenticitytoken = End.Replace("class=\"\">", "").Replace("<input type=\"hidden\"", "").Replace("class=\"\">", "").Replace("value=\"", "").Replace("\n", "").Replace("\"", "").Replace(" ", "");
            }
            catch (Exception ex)
            {
                Console.WriteLine("2 :" + ex.StackTrace);
            }
            try
            {
                bool   Created       = true;
                string url           = "https://twitter.com/users/email_available?suggest=1&username=&full_name=&email=" + Email.Replace("@", "%40").Replace(" ", "") + "&suggest_on_username=true&context=signup";
                string EmailCheck    = globusHelper.getHtmlfromUrl(new Uri(url), "https://twitter.com/signup", "");
                string Usernamecheck = globusHelper.getHtmlfromUrl(new Uri("https://twitter.com/users/username_available?suggest=1&username="******"&full_name=" + name + "&email=&suggest_on_username=true&context=signup"), "https://twitter.com/signup", "");

                if (EmailCheck.Contains("Email has already been taken. An email can only be used on one Twitter account at a time"))
                {
                    Created = false;
                }
                else if (Usernamecheck.Contains("Username has already been taken"))
                {
                    Created = false;
                }
                else if (EmailCheck.Contains("You cannot have a blank email address"))
                {
                    Created = false;
                }

                if (Created)
                {
                    byte[] args = webclient.DownloadData(ImageURL);

                    string[] arr1 = new string[] { "indianbill007", "sumit1234", "" };

                    string captchaText             = DecodeDBC(arr1, args);
                    string postdata                = "authenticity_token=" + authenticitytoken + "&user%5Bname%5D=" + name + "&user%5Bemail%5D=" + Email.Replace(" ", "") + "&user%5Buser_password%5D=" + Password + "&user%5Bscreen_name%5D=" + username + "&user%5Bremember_me_on_signup%5D=1&user%5Bremember_me_on_signup%5D=&context=&recaptcha_challenge_field=" + capcthavalue + "&recaptcha_response_field=" + HttpUtility.UrlEncode(captchaText) + "&user%5Bdiscoverable_by_email%5D=1&user%5Bsend_email_newsletter%5D=1";
                    string AccountcraetePageSource = globusHelper.postFormData(new Uri("https://twitter.com/account/create"), postdata, "https://twitter.com/signup", "", "", "", "");

                    if (AccountcraetePageSource.Contains("id=\"signout-form\"") && AccountcraetePageSource.Contains("/logout"))
                    {
                        MessageBox.Show("Account created");
                    }


                    if (Created)
                    {
                        ClsEmailActivator EmailActivate = new ClsEmailActivator();
                        bool verified = EmailActivate.EmailVerification(Email.Replace(" ", ""), Password, ref globusHelper);
                        if (verified)
                        {
                            AddToListBox("Account Verified");
                        }
                    }
                }
                else
                {
                    if (EmailCheck.Contains("Email has already been taken. An email can only be used on one Twitter account at a time"))
                    {
                        AddToListBox("Email has already been taken. An email can only be used on one Twitter account at a time");
                    }
                    else if (Usernamecheck.Contains("Username has already been taken"))
                    {
                        AddToListBox("Username has already been taken");
                    }
                    else if (EmailCheck.Contains("You cannot have a blank email address"))
                    {
                        AddToListBox("You cannot have a blank email address");
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("3 :" + ex.StackTrace);
            }
        }
コード例 #5
0
        /// <summary>
        /// Makes Http Request to Confirmation URL from Mail, also requests other JS, CSS URLs
        /// </summary>
        /// <param name="ConfirmationUrl"></param>
        /// <param name="gif"></param>
        /// <param name="logpic"></param>
        public void EmailVerificationMultithreaded(string ConfirmationUrl, string gif, string logpic, string email, string password, string proxyAddress, string proxyPort, string proxyUsername, string proxyPassword, ref GlobusHttpHelper HttpHelper)
        {
            int intProxyPort = 80;
            Regex IdCheck = new Regex("^[0-9]*$");

            if (!string.IsNullOrEmpty(proxyPort) && IdCheck.IsMatch(proxyPort))
            {
                intProxyPort = int.Parse(proxyPort);
            }

            string pgSrc_ConfirmationUrl = HttpHelper.getHtmlfromUrlProxy(new Uri(ConfirmationUrl), proxyAddress, intProxyPort, proxyUsername, proxyPassword);

            string valueLSD = "name=" + "\"lsd\"";
            string pgSrc_Login = HttpHelper.getHtmlfromUrl(new Uri("https://www.facebook.com/login.php"));

            int startIndex = pgSrc_Login.IndexOf(valueLSD) + 18;
            string value = pgSrc_Login.Substring(startIndex, 5);

            //Log("Logging in with " + Username);

            string ResponseLogin = HttpHelper.postFormDataProxy(new Uri("https://www.facebook.com/login.php?login_attempt=1"), "charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&lsd=" + value + "&locale=en_US&email=" + email.Split('@')[0] + "%40" + email.Split('@')[1] + "&pass="******"&persistent=1&default_persistent=1&charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&lsd=" + value + "", proxyAddress, intProxyPort, proxyUsername, proxyPassword);

            pgSrc_ConfirmationUrl = HttpHelper.getHtmlfromUrl(new Uri(ConfirmationUrl));

            try
            {
                string pgSrc_Gif = HttpHelper.getHtmlfromUrl(new Uri(gif));
            }
            catch { }
            try
            {
                string pgSrc_Logpic = HttpHelper.getHtmlfromUrl(new Uri(logpic + "&s=a"));
            }
            catch { }
            try
            {
                string pgSrc_Logpic = HttpHelper.getHtmlfromUrl(new Uri(logpic));
            }
            catch { }

            //** User Id ***************//////////////////////////////////
            string UsreId = string.Empty;
            if (string.IsNullOrEmpty(UsreId))
            {
                UsreId = GlobusHttpHelper.ParseJson(ResponseLogin, "user");
            }

            //*** Post Data **************//////////////////////////////////
            string fb_dtsg = GlobusHttpHelper.GetParamValue(ResponseLogin, "fb_dtsg");//pageSourceHome.Substring(pageSourceHome.IndexOf("fb_dtsg") + 16, 8);
            if (string.IsNullOrEmpty(fb_dtsg))
            {
                fb_dtsg = GlobusHttpHelper.ParseJson(ResponseLogin, "fb_dtsg");
            }

            string post_form_id = GlobusHttpHelper.GetParamValue(ResponseLogin, "post_form_id");//pageSourceHome.Substring(pageSourceHome.IndexOf("post_form_id"), 200);
            if (string.IsNullOrEmpty(post_form_id))
            {
                post_form_id = GlobusHttpHelper.ParseJson(ResponseLogin, "post_form_id");
            }

            string pgSrc_email_confirmed = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/?email_confirmed=1"));

            string pgSrc_contact_importer = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/gettingstarted.php?step=contact_importer"));


            #region Skipping Code

            ///Code for skipping additional optional Page
            try
            {
                string phstamp = "165816812085115" + RandomNumberGenerator.GenerateRandom(10848130, 10999999);

                string postDataSkipFirstStep = "post_form_id=" + post_form_id + "&fb_dtsg=" + fb_dtsg + "&step_name=friend_requests&next_step_name=contact_importer&skip=Skip&lsd&post_form_id_source=AsyncRequest&__user="******"&phstamp=" + phstamp;

                string postRes = HttpHelper.postFormData(new Uri("http://www.facebook.com/ajax/growth/nux/wizard/steps.php?__a=1"), postDataSkipFirstStep);
                Thread.Sleep(1000);
            }
            catch { }

            pgSrc_contact_importer = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/gettingstarted/?step=contact_importer"));


            //** FB Account Check email varified or not ***********************************************************************************//
            #region  FB Account Check email varified or not

            //string pageSrc1 = string.Empty;
            string pageSrc2 = string.Empty;
            string pageSrc3 = string.Empty;
            string pageSrc4 = string.Empty;
            string substr1 = string.Empty;

            //if (pgSrc_contact_importer.Contains("Are your friends already on Facebook?") && pgSrc_contact_importer.Contains("Skip this step"))
            if (true)
            {
                string phstamp = "16581677684757" + RandomNumberGenerator.GenerateRandom(5104244, 9999954);

                string newPostData = "post_form_id=" + post_form_id + "&fb_dtsg=" + fb_dtsg + "&step_name=contact_importer&next_step_name=classmates_coworkers&previous_step_name=friend_requests&skip=Skip%20this%20step&lsd&post_form_id_source=AsyncRequest&__user="******"&phstamp=" + phstamp + "";
                string postRes = HttpHelper.postFormData(new Uri("http://www.facebook.com/ajax/growth/nux/wizard/steps.php?__a=1"), newPostData);

                pgSrc_contact_importer = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/gettingstarted.php?step=classmates_coworkers"));

                Thread.Sleep(1000);

                //pgSrc_contact_importer = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/gettingstarted/?step=classmates_coworkers"));
            }
            //if ((pgSrc_contact_importer.Contains("Fill out your Profile Info") || pgSrc_contact_importer.Contains("Fill out your Profile info")) && pgSrc_contact_importer.Contains("Skip"))
            if (true)
            {
                string phstamp = "16581677684757" + RandomNumberGenerator.GenerateRandom(5104244, 9999954);

                string newPostData = "post_form_id=" + post_form_id + "&fb_dtsg=" + fb_dtsg + "&step_name=classmates_coworkers&next_step_name=upload_profile_pic&previous_step_name=contact_importer&current_pane=info&hs[school][id][0]=&hs[school][text][0]=&hs[start_year][text][0]=-1&hs[year][text][0]=-1&hs[entry_id][0]=&college[entry_id][0]=&college[school][id][0]=0&college[school][text][0]=&college[start_year][text][0]=-1&college[year][text][0]=-1&college[type][0]=college&work[employer][id][0]=0&work[employer][text][0]=&work[entry_id][0]=&skip=Skip&lsd&post_form_id_source=AsyncRequest&__user="******"&phstamp=" + phstamp + "";
                string postRes = HttpHelper.postFormData(new Uri("http://www.facebook.com/ajax/growth/nux/wizard/steps.php?__a=1"), newPostData);

                ///Post Data Parsing
                Dictionary<string, string> lstfriend_browser_id = new Dictionary<string, string>();

                string[] initFriendArray = Regex.Split(postRes, "FriendStatus.initFriend");

                int tempCount = 0;
                foreach (string item in initFriendArray)
                {
                    if (tempCount == 0)
                    {
                        tempCount++;
                        continue;
                    }
                    if (tempCount > 0)
                    {
                        int startIndx = item.IndexOf("(\\") + "(\\".Length + 1;
                        int endIndx = item.IndexOf("\\", startIndx);
                        string paramValue = item.Substring(startIndx, endIndx - startIndx);
                        lstfriend_browser_id.Add("friend_browser_id[" + (tempCount - 1) + "]=", paramValue);
                        tempCount++;
                    }
                }

                string partPostData = string.Empty;
                foreach (var item in lstfriend_browser_id)
                {
                    partPostData = partPostData + item.Key + item.Value + "&";
                }

                phstamp = "16581677684757" + RandomNumberGenerator.GenerateRandom(5104244, 9999954);

                string newPostData1 = "post_form_id=" + post_form_id + "&fb_dtsg=" + fb_dtsg + "&step_name=classmates_coworkers&next_step_name=upload_profile_pic&previous_step_name=contact_importer&current_pane=pymk&hs[school][id][0]=&hs[school][text][0]=&hs[year][text][0]=-1&hs[entry_id][0]=&college[entry_id][0]=&college[school][id][0]=0&college[school][text][0]=&college[year][text][0]=-1&college[type][0]=college&work[employer][id][0]=0&work[employer][text][0]=&work[entry_id][0]=&skip=Skip&lsd&post_form_id_source=AsyncRequest&__user="******"&" + partPostData + "phstamp=" + phstamp + "";//"post_form_id=" + post_form_id + "&fb_dtsg=" + fb_dtsg + "&step_name=classmates_coworkers&next_step_name=upload_profile_pic&previous_step_name=contact_importer&current_pane=pymk&friend_browser_id[0]=100002869910855&friend_browser_id[1]=100001857152486&friend_browser_id[2]=575678600&friend_browser_id[3]=100003506761599&friend_browser_id[4]=563402235&friend_browser_id[5]=1268675170&friend_browser_id[6]=1701838026&friend_browser_id[7]=623640106&friend_browser_id[8]=648873235&friend_browser_id[9]=100000151781814&friend_browser_id[10]=657007597&friend_browser_id[11]=1483373867&friend_browser_id[12]=778266161&friend_browser_id[13]=1087830021&friend_browser_id[14]=100001333876108&friend_browser_id[15]=100000534308531&friend_browser_id[16]=1213205246&friend_browser_id[17]=45608778&friend_browser_id[18]=100003080150820&friend_browser_id[19]=892195716&friend_browser_id[20]=100001238774509&friend_browser_id[21]=45602360&friend_browser_id[22]=100000054900916&friend_browser_id[23]=100001308090108&friend_browser_id[24]=100000400766182&friend_browser_id[25]=100001159247338&friend_browser_id[26]=1537081666&friend_browser_id[27]=100000743261988&friend_browser_id[28]=1029373920&friend_browser_id[29]=1077680976&friend_browser_id[30]=100000001266475&friend_browser_id[31]=504487658&friend_browser_id[32]=82600225&friend_browser_id[33]=1023509811&friend_browser_id[34]=100000128061486&friend_browser_id[35]=100001853125513&friend_browser_id[36]=576201748&friend_browser_id[37]=22806492&friend_browser_id[38]=100003232772830&friend_browser_id[39]=1447942875&friend_browser_id[40]=100000131241521&friend_browser_id[41]=100002076794734&friend_browser_id[42]=1397169487&friend_browser_id[43]=1457321074&friend_browser_id[44]=1170969536&friend_browser_id[45]=18903839&friend_browser_id[46]=695329369&friend_browser_id[47]=1265734280&friend_browser_id[48]=698096805&friend_browser_id[49]=777678515&friend_browser_id[50]=529685319&hs[school][id][0]=&hs[school][text][0]=&hs[year][text][0]=-1&hs[entry_id][0]=&college[entry_id][0]=&college[school][id][0]=0&college[school][text][0]=&college[year][text][0]=-1&college[type][0]=college&work[employer][id][0]=0&work[employer][text][0]=&work[entry_id][0]=&skip=Skip&lsd&post_form_id_source=AsyncRequest&__user=100003556207009&phstamp=1658167541109987992266";
                string postRes1 = HttpHelper.postFormData(new Uri("http://www.facebook.com/ajax/growth/nux/wizard/steps.php?__a=1"), newPostData1);

                pageSrc2 = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/gettingstarted.php?step=upload_profile_pic"));

                Thread.Sleep(1000);

                //pageSrc2 = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/gettingstarted.php?step=upload_profile_pic"));

                string image_Get = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/images/wizard/nuxwizard_profile_picture.gif"));

                try
                {
                    phstamp = "16581677684757" + RandomNumberGenerator.GenerateRandom(5104244, 9999954);
                    string newPostData2 = "post_form_id=" + post_form_id + "&fb_dtsg=" + fb_dtsg + "&step=upload_profile_pic&step_name=upload_profile_pic&previous_step_name=classmates_coworkers&skip=Skip&lsd&post_form_id_source=AsyncRequest&__user="******"&phstamp=" + phstamp + "";
                    string postRes2 = HttpHelper.postFormData(new Uri("http://www.facebook.com/ajax/growth/nux/wizard/steps.php?__a=1"), newPostData2);
                }
                catch { }
                try
                {
                    phstamp = "16581677684757" + RandomNumberGenerator.GenerateRandom(5104244, 9999954);
                    string newPostData3 = "post_form_id=" + post_form_id + "&fb_dtsg=" + fb_dtsg + "&step=upload_profile_pic&step_name=upload_profile_pic&previous_step_name=classmates_coworkers&submit=Save%20%26%20Continue&lsd&post_form_id_source=AsyncRequest&__user="******"&phstamp=" + phstamp + "";
                    string postRes3 = HttpHelper.postFormData(new Uri("http://www.facebook.com/ajax/growth/nux/wizard/steps.php?__a=1"), newPostData3);
                }
                catch { }

            }
            if (pageSrc2.Contains("Set your profile picture") && pageSrc2.Contains("Skip"))
            {
                string phstamp = "16581677684757" + RandomNumberGenerator.GenerateRandom(5104244, 9999954);
                string newPostData = "post_form_id=" + post_form_id + "&fb_dtsg=" + fb_dtsg + "&step_name=upload_profile_pic&previous_step_name=classmates_coworkers&skip=Skip&lsd&post_form_id_source=AsyncRequest&__user="******"&phstamp=" + phstamp + "";
                try
                {
                    string postRes = HttpHelper.postFormData(new Uri("http://www.facebook.com/ajax/growth/nux/wizard/steps.php?__a=1"), newPostData);

                    pageSrc3 = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/gettingstarted.php?step=summary"));
                    pageSrc3 = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/home.php?ref=wizard"));
                }
                catch { }

            }
            #endregion
            if (pageSrc3.Contains("complete the sign-up process"))
            {
            }
            if (pgSrc_contact_importer.Contains("complete the sign-up process"))
            {
            }
            #endregion

            ////**Post Message For User***********************/////////////////////////////////////////////////////

            try
            {

                string pageSourceHome = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/home.php"));

                if (pageSourceHome.Contains("complete the sign-up process"))
                {
                    Console.WriteLine("Account is not verified for : " + email);
                }
                else
                {
                }
            }
            catch { }

            AddToListBox("Email verification completed for : " + email);
            //LoggerVerify("Email verification completed for : " + Email);
        }
コード例 #6
0
        public void LoginHttpHelper(ref LinkedinUser linkedUser)
        {
            try
            {
                GlobusHttpHelper objGlobusHttpHelper = new GlobusHttpHelper();
                linkedUser.globusHttpHelper = objGlobusHttpHelper;
                GlobusHttpHelper HttpHelper = linkedUser.globusHttpHelper;


                GlobusLogHelper.log.Info("Logging In With Account : " + linkedUser.username);
                GlobusLogHelper.log.Info("Login Process is Running... ");
                string Url          = LDGlobals.Instance.LDhomeurl;
                string pageSrcLogin = string.Empty;
                int    ProxyPort    = 0;
                if (!string.IsNullOrEmpty(linkedUser.proxyport) && NumberHelper.ValidateNumber(linkedUser.proxyport))
                {
                    ProxyPort = int.Parse(linkedUser.proxyport);
                }
                pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), "", linkedUser.proxyip, linkedUser.proxyport, linkedUser.proxyusername, linkedUser.proxypassword);
                if (pageSrcLogin.Contains("Sign Out"))
                {
                    return;
                }
                string postdata     = string.Empty;
                string postUrl      = string.Empty;
                string ResLogin     = string.Empty;
                string csrfToken    = string.Empty;
                string regCsrfParam = string.Empty;
                string sourceAlias  = string.Empty;


                if (pageSrcLogin.Contains("csrfToken"))
                {
                    try
                    {
                        int    startIndex = pageSrcLogin.IndexOf("name=\"csrfToken\"");
                        string start      = pageSrcLogin.Substring(startIndex).Replace("name=\"csrfToken\"", "");
                        int    endIndex   = start.IndexOf("\" ");
                        string end        = start.Substring(0, endIndex).Replace("value=\"", "").Trim();
                        csrfToken = end;
                        if (csrfToken.Contains(LDGlobals.Instance.LDhomeurl))
                        {
                            csrfToken = Utils.getBetween("@@@@@@@" + csrfToken, "@@@@@@@", "\"/></form>");
                        }
                        //csrfToken = csrfToken;
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                }

                try
                {
                    if (csrfToken.Contains("&"))
                    {
                        string[] Arr = csrfToken.Split('&');
                        csrfToken = Arr[0].Replace("\"", string.Empty);
                    }
                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                }

                if (pageSrcLogin.Contains("sourceAlias"))
                {
                    sourceAlias = pageSrcLogin.Substring(pageSrcLogin.IndexOf("sourceAlias"), 100);
                    string[] Arr = sourceAlias.Split('"');
                    sourceAlias = Arr[2].Replace(@"\", string.Empty).Replace("//", string.Empty).Trim();
                }


                try
                {
                    int SourceAliasStart = pageSrcLogin.IndexOf("regCsrfParam");
                    if (SourceAliasStart > 0)
                    {
                        try
                        {
                            regCsrfParam = pageSrcLogin.Substring(pageSrcLogin.IndexOf("regCsrfParam"), 100);
                            string[] Arr = regCsrfParam.Split('"');
                            regCsrfParam = Arr[2].Replace(@"\", string.Empty).Replace("//", string.Empty);
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }
                    if (string.IsNullOrEmpty(regCsrfParam))
                    {
                        regCsrfParam = Utils.getBetween(pageSrcLogin, "loginCsrfParam", "/>");
                        regCsrfParam = Utils.getBetween(regCsrfParam, "value=\"", "\"");
                    }
                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                }

                postUrl  = "https://www.linkedin.com/uas/login-submit";
                postdata = "isJsEnabled=true&source_app=&tryCount=&session_key=" + Uri.EscapeDataString(linkedUser.username) + "&session_password="******"&signin=Sign%20In&session_redirect=&loginCsrfParam=" + regCsrfParam + "&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;

                int port = 80;
                try
                {
                    port     = Convert.ToInt32(linkedUser.proxyport);
                    ResLogin = HttpHelper.postFormDataProxy(new Uri(postUrl), postdata, "", linkedUser.proxyip, port, linkedUser.proxyusername, linkedUser.proxypassword);//HttpHelper.postFormDataRef(new Uri(postUrl), postdata, "https://www.linkedin.com/uas/login?goback=&trk=hb_signin", "", "");
                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                }

                if (ResLogin.Contains("Request Error") || ResLogin.Contains("Join Today"))
                {
                    Url      = "https://www.linkedin.com/";
                    postdata = "isJsEnabled=true&source_app=&tryCount=&clickedSuggestion=false&session_key=" + Uri.EscapeDataString(linkedUser.username) + "&session_password="******"&signin=Sign%20In&session_redirect=&trk=hb_signin&loginCsrfParam=" + regCsrfParam + "&fromEmail=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias + "&client_ts=1434028850511&client_r=rairaaz4%40gmail.com%3A910202384%3A297133466%3A594693585&client_output=-480305440&client_n=910202384%3A297133466%3A594693585&client_v=1.0.1";
                    ResLogin = HttpHelper.postFormDataProxy(new Uri(postUrl), postdata, "", linkedUser.proxyip, port, linkedUser.proxyusername, linkedUser.proxypassword);
                }


                string ImageUrl           = string.Empty;
                string captchaText        = string.Empty;
                string captchachallengeid = string.Empty;
                string dts                        = string.Empty;
                string origActionAlias            = string.Empty;
                string origSourceAlias            = string.Empty;
                string irhf                       = string.Empty;
                string submissionID               = string.Empty;
                string CAPTCHAfwdcsrftoken        = string.Empty;
                string CAPTCHAfwdsignin           = string.Empty;
                string CAPTCHAfwdsession_password = string.Empty;
                string CAPTCHAfwdsession_key      = string.Empty;
                string CAPTCHAfwdisJsEnabled      = string.Empty;
                string CAPTCHAfwdloginCsrfParam   = string.Empty;


                #region coommented seurity verification
                //if (ResLogin.Contains("Security Verification"))
                //{
                //    string dataforcapctha = HttpHelper.getHtmlfromUrl1(new Uri("https://www.google.com/recaptcha/api/noscript?k=6LcnacMSAAAAADoIuYvLUHSNLXdgUcq-jjqjBo5n"));
                //    if (!string.IsNullOrEmpty(dataforcapctha))
                //    {
                //        int startindex = dataforcapctha.IndexOf("id=\"recaptcha_challenge_field\"");
                //        if (startindex > 0)
                //        {
                //            string start = dataforcapctha.Substring(startindex).Replace("id=\"recaptcha_challenge_field\"", "");
                //            int endindex = start.IndexOf("\">");
                //            string end = start.Substring(0, endindex).Replace("value=", string.Empty).Replace("\"", string.Empty).Trim();
                //            ImageUrl = "https://www.google.com/recaptcha/api/image?c=" + end;
                //            System.Net.WebClient webclient = new System.Net.WebClient();
                //            byte[] args = webclient.DownloadData(ImageUrl);
                //            string[] arr1 = new string[] { Globals.CapchaLoginID, Globals.CapchaLoginPassword, "" };
                //            captchaText = DecodeDBC(arr1, args);
                //        }

                //        if (ResLogin.Contains("name=\"security-challenge-id\""))
                //        {
                //            int startindexnew = ResLogin.IndexOf("name=\"security-challenge-id\"");
                //            if (startindexnew > 0)
                //            {
                //                string start = ResLogin.Substring(startindexnew).Replace("name=\"security-challenge-id\"", "").Replace("value=\"", "");
                //                int endindex = start.IndexOf("\"");
                //                string end = start.Substring(0, endindex);
                //                captchachallengeid = end.Replace("\"", string.Empty).Trim();
                //            }
                //        }

                //        if (ResLogin.Contains("name=\"dts\""))
                //        {
                //            int startindexnew = ResLogin.IndexOf("name=\"dts\"");
                //            if (startindexnew > 0)
                //            {
                //                string start = ResLogin.Substring(startindexnew).Replace("name=\"dts\"", "").Replace("value=\"", "");
                //                int endindex = start.IndexOf("\"");
                //                string end = start.Substring(0, endindex);
                //                dts = end.Replace("\"", string.Empty).Trim();
                //            }
                //        }

                //        if (ResLogin.Contains("name=\"origActionAlias\""))
                //        {
                //            int startindexnew = ResLogin.IndexOf("name=\"origActionAlias\"");
                //            if (startindexnew > 0)
                //            {
                //                string start = ResLogin.Substring(startindexnew).Replace("name=\"origActionAlias\"", "").Replace("value=\"", "");
                //                int endindex = start.IndexOf("\"");
                //                string end = start.Substring(0, endindex);
                //                origActionAlias = end.Replace("\"", string.Empty).Trim();
                //            }
                //        }

                //        if (ResLogin.Contains("name=\"submissionId\""))
                //        {
                //            int startindexnew = ResLogin.IndexOf("name=\"submissionId\"");
                //            if (startindexnew > 0)
                //            {
                //                string start = ResLogin.Substring(startindexnew).Replace("name=\"submissionId\"", string.Empty).Replace("value=\"", string.Empty);
                //                int endindex = start.IndexOf("\"");
                //                string end = start.Substring(0, endindex);
                //                submissionID = end.Replace("\"", string.Empty).Trim();
                //            }
                //        }
                //        if (ResLogin.Contains("name=\"CAPTCHA-fwd-csrfToken\""))
                //        {
                //            int startindexnew = ResLogin.IndexOf("name=\"CAPTCHA-fwd-csrfToken\"");
                //            if (startindexnew > 0)
                //            {
                //                string start = ResLogin.Substring(startindexnew).Replace("name=\"CAPTCHA-fwd-csrfToken\"", string.Empty).Replace("value=\"", string.Empty);
                //                int endindex = start.IndexOf("\"");
                //                string end = start.Substring(0, endindex);
                //                CAPTCHAfwdcsrftoken = end.Replace("\"", string.Empty).Trim();
                //            }
                //        }
                //        if (ResLogin.Contains("name=\"CAPTCHA-fwd-signin\""))
                //        {
                //            int startindexnew = ResLogin.IndexOf("name=\"CAPTCHA-fwd-signin\"");
                //            if (startindexnew > 0)
                //            {
                //                string start = ResLogin.Substring(startindexnew).Replace("name=\"CAPTCHA-fwd-signin\"", string.Empty).Replace("value=\"", string.Empty);
                //                int endindex = start.IndexOf("\"");
                //                string end = start.Substring(0, endindex);
                //                CAPTCHAfwdsignin = end.Replace("\"", string.Empty).Trim();
                //            }
                //        }
                //        if (ResLogin.Contains("name=\"CAPTCHA-fwd-session_password\""))
                //        {
                //            int startindexnew = ResLogin.IndexOf("name=\"CAPTCHA-fwd-session_password\"");
                //            if (startindexnew > 0)
                //            {
                //                string start = ResLogin.Substring(startindexnew).Replace("name=\"CAPTCHA-fwd-session_password\"", string.Empty).Replace("value=\"", string.Empty);
                //                int endindex = start.IndexOf("\"");
                //                string end = start.Substring(0, endindex);
                //                CAPTCHAfwdsession_password = end.Replace("\"", string.Empty).Trim();
                //            }
                //        }
                //        if (ResLogin.Contains("name=\"CAPTCHA-fwd-session_key\""))
                //        {
                //            int startindexnew = ResLogin.IndexOf("name=\"CAPTCHA-fwd-session_key\"");
                //            if (startindexnew > 0)
                //            {
                //                string start = ResLogin.Substring(startindexnew).Replace("name=\"CAPTCHA-fwd-session_key\"", string.Empty).Replace("value=\"", string.Empty);
                //                int endindex = start.IndexOf("\"");
                //                string end = start.Substring(0, endindex);
                //                CAPTCHAfwdsession_key = end.Replace("\"", string.Empty).Trim();
                //            }
                //        }
                //        if (ResLogin.Contains("name=\"CAPTCHA-fwd-isJsEnabled\""))
                //        {
                //            int startindexnew = ResLogin.IndexOf("name=\"CAPTCHA-fwd-isJsEnabled\"");
                //            if (startindexnew > 0)
                //            {
                //                string start = ResLogin.Substring(startindexnew).Replace("name=\"CAPTCHA-fwd-isJsEnabled\"", string.Empty).Replace("value=\"", string.Empty);
                //                int endindex = start.IndexOf("\"");
                //                string end = start.Substring(0, endindex);
                //                CAPTCHAfwdisJsEnabled = end.Replace("\"", string.Empty).Trim();
                //            }
                //        }
                //        if (ResLogin.Contains("name=\"CAPTCHA-fwd-loginCsrfParam\""))
                //        {
                //            int startindexnew = ResLogin.IndexOf("name=\"CAPTCHA-fwd-loginCsrfParam\"");
                //            if (startindexnew > 0) ;
                //            {
                //                string start = ResLogin.Substring(startindexnew).Replace("name=\"CAPTCHA-fwd-loginCsrfParam\"", string.Empty).Replace("value=\"", string.Empty);
                //                int endindex = start.IndexOf("\"");
                //                string end = start.Substring(0, endindex);
                //                CAPTCHAfwdloginCsrfParam = end.Replace("\"", string.Empty).Trim();
                //            }
                //        }


                //        if (ResLogin.Contains("name=\"origSourceAlias\""))
                //        {
                //            int startindexnew = ResLogin.IndexOf("name=\"origSourceAlias\"");
                //            if (startindexnew > 0)
                //            {
                //                string start = ResLogin.Substring(startindexnew).Replace("name=\"origSourceAlias\"", "").Replace("value=\"", "");
                //                int endindex = start.IndexOf("\"");
                //                string end = start.Substring(0, endindex);
                //                origSourceAlias = end.Replace("\"", string.Empty).Trim();
                //            }
                //        }

                //        if (ResLogin.Contains("name=\"irhf\""))
                //        {
                //            int startindexnew = ResLogin.IndexOf("name=\"irhf\"");
                //            if (startindexnew > 0)
                //            {
                //                string start = ResLogin.Substring(startindexnew).Replace("name=\"irhf\"", "").Replace("value=\"", "");
                //                int endindex = start.IndexOf("\"");
                //                string end = start.Substring(0, endindex);
                //                irhf = end.Replace("\"", string.Empty).Trim();
                //            }
                //        }

                //        if (!string.IsNullOrEmpty(ImageUrl) && !string.IsNullOrEmpty(captchaText))
                //        {
                //            //postdata = "recaptcha_challenge_field=" + ImageUrl.Replace("https://www.google.com/recaptcha/api/image?c=", string.Empty) + "&recaptcha_response_field=" + captchaText.Replace(" ", "+") + "&dts=" + dts + "&security-challenge-id=" + captchachallengeid + "&hr=&source_app=&csrfToken=" + csrfToken + "&isJsEnabled=true&session_redirect=&session_password="******"&session_key=" + Uri.EscapeDataString(accountUser) + "&origSourceAlias=" + origSourceAlias + "&origActionAlias=" + origActionAlias + "&irhf=" + irhf + "&sourceAlias=" + sourceAlias + "&submissionId=" + submissionID + ;
                //            postdata = "recaptcha_challenge_field=" + ImageUrl.Replace("https://www.google.com/recaptcha/api/image?c=", string.Empty) + "&recaptcha_response_field=" + captchaText.Replace(" ", "+") + "&irhf=" + irhf + "&dts=" + dts + "&security-challenge-id=" + captchachallengeid + "&submissionId=" + submissionID + "&CAPTCHA-fwd-csrfToken=" + CAPTCHAfwdcsrftoken + "&CAPTCHA-fwd-isJsEnabled=" + CAPTCHAfwdisJsEnabled + "&CAPTCHA-fwd-signin=" + CAPTCHAfwdsignin + "&CAPTCHA-fwd-loginCsrfParam=" + CAPTCHAfwdloginCsrfParam + "&CAPTCHA-fwd-session_password="******"&CAPTCHAfwd-session_key=" + CAPTCHAfwdsession_key + "&session_password="******"&session_key=" + Uri.EscapeDataString(accountUser) + "&origSourceAlias=" + origSourceAlias + "&origActionAlias=" + origActionAlias + "&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;
                //            postdata = postdata.Replace(" ", string.Empty);
                //            ResLogin = HttpHelper.postFormDataRef(new Uri("https://www.linkedin.com/uas/captcha-submit"), postdata, "https://www.linkedin.com/uas/login-submit", string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
                //        }
                //        else
                //        {
                //            ResLogin = string.Empty;
                //        }

                //        if (ResLogin.Contains("The text you entered does not match the characters in the security image. Please try again with this new image") || string.IsNullOrEmpty(ResLogin))
                //        {
                //            Log("[ " + DateTime.Now + " ] => [ " + accountUser + "  Cannot Login because of Captcha ]");
                //            GlobusFileHelper.WriteStringToTextfile(accountUser + ":" + accountPass + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUserName + ":" + proxyPassword, Globals.pathCapcthaLogin);
                //            SearchCriteria.loginREsponce = string.Empty;
                //            //FrmScrapGroupMember.ChangeToNextAccount = true;
                //        }
                //    }
                //}
                #endregion

                if (ResLogin.Contains("Sign Out") || ResLogin.Contains("class=\"signout\"") || ResLogin.Contains("Cerrar sesión"))
                {
                    linkedUser.isloggedin = true;

                    GlobusLogHelper.log.Info("Logged In With Account : " + linkedUser.username);
                    try
                    {
                        // string Search = HttpHelper.getHtmlfromUrlProxy(new Uri("https://www.linkedin.com/search?trk=advsrch"),"", linkedUser.proxyip, linkedUser.proxyport, linkedUser.proxyusername, linkedUser.proxypassword);
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                }
                else if (ResLogin.Contains("logout?session_full_logout"))
                {
                    string Search = HttpHelper.getHtmlfromUrlProxy(new Uri("https://www.linkedin.com/search?trk=advsrch"), "", linkedUser.proxyip, linkedUser.proxyport, linkedUser.proxyusername, linkedUser.proxypassword);
                }
                else if (ResLogin.Contains("Sign-In Verification"))
                {
                    GlobusLogHelper.log.Info(" Verification required : " + linkedUser.username);
                }
                else if (ResLogin.Contains("Your LinkedIn account has been temporarily restricted"))
                {
                    GlobusLogHelper.log.Info("Your LinkedIn account : " + linkedUser.username + " has been temporarily restricted ");
                }
                else
                {
                    GlobusLogHelper.log.Info("NotLogged In With Account : " + linkedUser.username);
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Info("NotLogged In With Account : " + linkedUser.username);
            }
        }
コード例 #7
0
ファイル: PageManager.cs プロジェクト: shah8701/faceboard
        /// <summary>
        /// Processes Comment IDs
        /// Gets Next Page URL as well as End User IDs
        /// </summary>
        /// <param name="objCommentID">Comment ID</param>
        private void StartMission_Comments(object objCommentID)
        {
            string CommentID = string.Empty;
            try
            {
                if (!isStopFanPageScraper)
                {
                    //string CommentID = (string)objCommentID;

                    string[] arrayParameters = (string[])objCommentID;

                    CommentID = (string)arrayParameters.GetValue(0);
                    string PageURL = (string)arrayParameters.GetValue(1);//(string)objCommentID;

                    GlobusHttpHelper httpHelper = new GlobusHttpHelper();
                    string GraphUrl = FBGlobals.Instance.fbgraphUrl + CommentID;

                    string jsonRes = string.Empty;

                    try
                    {
                        jsonRes = httpHelper.getHtmlfromUrlProxy(new Uri(FBGlobals.Instance.fbgraphUrl + CommentID + ""), "", 80, "", "");
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }

                    ParseJson_Comments_Phase1(jsonRes, PageURL);

                    ParseJson_Comments_Next_Phase1(jsonRes, PageURL);

                    ///After processing Comment ID, Update its Status as 1 => Processed 
                    try
                    {
                        //qm.UpdateStatusForLevelOne(CommentID);

                        DataSet ds = new DataSet();

                        RaiseEvent(ds, new string[] { "Model : FanPagePostRepository", "Function : UpdateStatusUsingFriendId", CommentID });

                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
            finally
            {
                //if (!IsCloseCalled)
                {
                    countThreadController--;
                    lock (lockrThreadController)
                    {
                        //if (!IsCloseCalled)
                        {
                            Monitor.Pulse(lockrThreadController);
                        }
                    }
                }
            }
        }
コード例 #8
0
ファイル: PageManager.cs プロジェクト: shah8701/faceboard
        private void ParseJson_Phase2(object jsonRes)
        {
            try
            {
                lstFanPageScraperThreads.Add(Thread.CurrentThread);
                lstFanPageScraperThreads.Distinct();
                Thread.CurrentThread.IsBackground = true;
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }

            string Firstid = string.Empty;
            try
            {

                if (!isStopFanPageScraper)
                {
                    GlobusHttpHelper httpHelper = new GlobusHttpHelper();

                    string jsonItem = (string)jsonRes;

                    string[] idData = jsonItem.Split('^');

                    string url = string.Empty;
                    if (idData.Count() == 2)
                    {
                        Firstid = idData[0].ToString();
                        url = idData[1].ToString();
                    }


                    string jsonData = httpHelper.getHtmlfromUrlProxy(new Uri(FBGlobals.Instance.fbgraphUrl + Firstid + ""), "", 80, "", "");

                    JObject Data = JObject.Parse(jsonData);

                    string id = (string)((JValue)Data["id"]);
                    string name = (string)((JValue)Data["name"]);
                    string first_name = (string)((JValue)Data["first_name"]);
                    string middle_name = (string)((JValue)Data["middle_name"]);
                    string last_name = (string)((JValue)Data["last_name"]);
                    string link = (string)((JValue)Data["link"]);
                    string gender = (string)((JValue)Data["gender"]);
                    string locale = (string)((JValue)Data["locale"]);

                    if (string.IsNullOrEmpty(link))
                    {
                        string username = (string)((JValue)Data["username"]);
                        if (!string.IsNullOrEmpty(username))
                        {
                            link = FBGlobals.Instance.fbhomeurl + username;
                        }
                        else
                        {
                            link = FBGlobals.Instance.fbhomeurl + id;
                        }

                    }



                    string UserName = string.Empty;
                    if (jsonData.Contains("username"))
                    {
                        try
                        {
                            string UserName1 = jsonData.Substring(jsonData.IndexOf("username"));
                            string[] ArrTemp = UserName1.Split('"');
                            UserName = ArrTemp[2];

                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }
                    string FBEmailId = string.Empty;
                    if (!string.IsNullOrEmpty(UserName))
                    {
                        FBEmailId = UserName + "@facebook.com";
                    }
                    else
                    {
                        FBEmailId = UserName + "@facebook.com"; ;
                    }


                    string Mainurl = url;

                    try
                    {
                        try
                        {

                            QueueInsertQuery("Insert into tb_FanpageScraper (id,name,first_name,middle_name,last_name,link,gender,locale,ProfileStatus,url,ShowUser) values('" + (id) + "','" + (name) + "','" + (first_name) + "','" + (middle_name) + "','" + (last_name) + "','" + (link) + "','" + (gender) + "','" + (locale) + "','1','" + url + "','0')", id);

                            DataSet ds = new DataSet();
                            RaiseEvent(ds, new string[] { "Model : FanPageDataRepository", "Function : Insert", id, name, first_name, middle_name, last_name, link, gender, locale, "1", url, "0" });


                            GlobusLogHelper.log.Info(Data + " : Added");
                            GlobusLogHelper.log.Debug(Data + " : Added");

                            count++;

                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }

                        try
                        {
                            string CSVHeader = "FriendId" + "," + "Name" + "," + "FirstName" + "," + "MiddleName" + "," + "LastName" + "," + "ProfileLink/Url" + "," + "Gender" + "," + "Locale" + "," + "FanPageURL"+","+"FbEmail";
                            string CSV_Content = id + "," + name + "," + first_name + "," + middle_name + "," + last_name + "," + link + "," + gender + "," + locale + "," + url + "," + FBEmailId;

                            Globussoft.GlobusFileHelper.ExportDataCSVFile(CSVHeader, CSV_Content, ScrapersFansScraperExprotFilePath);
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
            finally
            {
                try
                {
                    countDequeParseThreads--;
                    lock (lockerthreadsqueIds)
                    {
                        Monitor.Pulse(lockerthreadsqueIds);
                    }
                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                }
            }
        }
コード例 #9
0
ファイル: TwitterSignUp.cs プロジェクト: ahmetDostr/twtboard
        //Added By abhishek
        public System.Collections.Specialized.NameValueCollection SignupManual(object parameters, GlobusHttpHelper globusHelper)
        {
            Array paramsArray = new object[4];
            paramsArray = (Array)parameters;

            System.Collections.Specialized.NameValueCollection nvc = new System.Collections.Specialized.NameValueCollection();

            string DBCUsername = BaseLib.Globals.DBCUsername;
            string DBCPAssword = BaseLib.Globals.DBCPassword;
            //GlobusHttpHelper globusHelper = new GlobusHttpHelper();

            string ImageURL = string.Empty;
            string authenticitytoken = string.Empty;
            string capcthavalue = string.Empty;

            string Email = string.Empty;//"*****@*****.**";
            string Password = string.Empty;//"1JESUS11";

            string proxyAddress = string.Empty;
            string proxyPort = string.Empty;
            string proxyUsername = string.Empty;
            string proxyPassword = string.Empty;

            string emailData = (string)paramsArray.GetValue(0);
            string username = (string)paramsArray.GetValue(1);
            string name = (string)paramsArray.GetValue(2);
            string Proxy = (string)paramsArray.GetValue(3);
            bool Created = true;

            try
            {

                int Count = emailData.Split(':').Length;
                if (Count == 1)
                {
                    Log("[ " + DateTime.Now + " ] => [ Uploaded Emails Not In correct Format ]");
                    Log("[ " + DateTime.Now + " ] => [ " + emailData + " ]");
                }
                if (Count == 2)
                {
                    Email = emailData.Split(':')[0].Replace("\0", "");
                    Password = emailData.Split(':')[1].Replace("\0", "");
                }
                else if (Count == 4)
                {
                    Email = emailData.Split(':')[0].Replace("\0", "");
                    Password = emailData.Split(':')[1].Replace("\0", "");
                    proxyAddress = emailData.Split(':')[2];
                    proxyPort = emailData.Split(':')[3];
                }
                else if (Count == 6)
                {
                    Email = emailData.Split(':')[0].Replace("\0", "");
                    Password = emailData.Split(':')[1].Replace("\0", "");
                    proxyAddress = emailData.Split(':')[2];
                    proxyPort = emailData.Split(':')[3];
                    proxyUsername = emailData.Split(':')[4];
                    proxyPassword = emailData.Split(':')[5];
                }
                else
                {
                    Log("[ " + DateTime.Now + " ] => [ Uploaded Emails Not In correct Format ]");
                    Log("[ " + DateTime.Now + " ] => [ " + emailData + " ]");
                }
            }
            catch (Exception ex)
            {
                Log(ex.Message); Console.WriteLine("8 :" + ex.StackTrace);
                GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- Email Pass --> " + ex.Message, Globals.Path_AccountCreatorErrorLog);
                GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  SignupMultiThreaded() -- Email Pass >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs);
            }

            try
            {
                RaiseEvent_AddToDictionary(Email);
            }
            catch (Exception ex) { Console.WriteLine(ex.StackTrace); }

            try
            {
                if (Proxy.Split(':').Length == 4)
                {
                    proxyAddress = Proxy.Split(':')[0];
                    proxyPort = Proxy.Split(':')[1];
                    proxyUsername = Proxy.Split(':')[2];
                    proxyPassword = Proxy.Split(':')[3];
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("7 :" + ex.StackTrace);
                GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- Proxy Split --> " + ex.Message, Globals.Path_AccountCreatorErrorLog);
                GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  SignupMultiThreaded() -- Proxy Split >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs);
            }

            string url = "https://twitter.com/users/email_available?suggest=1&username=&full_name=&email=" + Email.Replace("@", "%40").Replace(" ", "") + "&suggest_on_username=true&context=signup";
            string EmailCheck = globusHelper.getHtmlfromUrlProxy(new Uri(url), proxyAddress, proxyPort, proxyUsername, proxyPassword, "https://twitter.com/signup", "");
            if (EmailCheck.Contains("\"taken\":true"))
            {
                Log("[ " + DateTime.Now + " ] => [ Email : " + Email + " has already been taken. An email can only be used on one Twitter account at a time ]");
                Created = false;
                GlobusFileHelper.AppendStringToTextfileNewLine(emailData.Replace("\0", ""), Globals.path_EmailAlreadyTaken);
                nvc.Clear();
                return nvc;
            }

            //Get User name .....
            try
            {
                username = username.Replace("\0", "");
                Password = Password.Replace("\0", "");
                if (!(username.Count() < 15 || Password.Count() > 6))
                {
                    if (username.Count() > 15)
                    {
                        Log("[ " + DateTime.Now + " ] => [ Username Must Not be greater than 15 character ]");
                        username = username.Remove(13); //Removes the extra characters
                    }
                    else if (Password.Count() < 6)
                    {
                        Log("[ " + DateTime.Now + " ] => [ Password Must Not be less than 6 char ]");
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("6 :" + ex.StackTrace);
                GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- Check Username --> " + ex.Message, Globals.Path_AccountCreatorErrorLog);
                GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  SignupMultiThreaded() -- Check Username >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs);
            }

            Random randm = new Random();
            double cachestop = randm.NextDouble();
            string pagesource2 = string.Empty;
            string textUrl = string.Empty;

            try
            {
                textUrl = globusHelper.getHtmlfromUrlProxy(new Uri("https://twitter.com/signup"), proxyAddress, proxyPort, proxyUsername, proxyPassword, "", "");
                string pagesource1 = globusHelper.getHtmlfromUrlProxy(new Uri("https://www.google.com/recaptcha/api/js/recaptcha_ajax.js"), proxyAddress, proxyPort, proxyUsername, proxyPassword, "", "");
                pagesource2 = globusHelper.getHtmlfromUrlProxy(new Uri("https://www.google.com/recaptcha/api/challenge?k=6LfbTAAAAAAAAE0hk8Vnfd1THHnn9lJuow6fgulO&ajax=1&cachestop=" + cachestop + "&lang=en"), proxyAddress, proxyPort, proxyUsername, proxyPassword, "", "");
            }
            catch (Exception ex)
            {
                Console.WriteLine("5 :" + ex.StackTrace);
                GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- Getting Signup PageSource --> " + ex.Message, Globals.Path_AccountCreatorErrorLog);
                GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  SignupMultiThreaded() -- Getting Signup PageSource >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs);
            }

            try
            {
                int IndexStart = pagesource2.IndexOf("challenge :");
                if (IndexStart > 0)
                {
                    string Start = pagesource2.Substring(IndexStart);
                    int IndexEnd = Start.IndexOf("',");
                    string End = Start.Substring(0, IndexEnd).Replace("challenge :", "").Replace("'", "").Replace(" ", "");
                    capcthavalue = End;
                    ImageURL = "https://www.google.com/recaptcha/api/image?c=" + End;
                }
                else
                {
                    Log("[ " + DateTime.Now + " ] => [ Cannot Find challenge Captcha on Page. Email : Password --> " + Email + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword + " ]");
                    GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.Path_CaptchaRequired);
                    nvc.Clear();
                    return nvc;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("1 :" + ex.StackTrace);
                GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- Getting Image Url --> " + ex.Message, Globals.Path_AccountCreatorErrorLog);
                GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  SignupMultiThreaded() -- Getting Image Url >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs);
            }

            WebClient webclient = new WebClient();
            try
            {
                int intProxyPort = 80;
                if (!string.IsNullOrEmpty(proxyPort) && GlobusRegex.ValidateNumber(proxyPort))
                {
                    intProxyPort = int.Parse(proxyPort);
                }
                ChangeProxy_WebClient(proxyAddress, intProxyPort, proxyUsername, proxyPassword, ref webclient);
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- ChangeProxy_WebClient() --> " + ex.Message, Globals.Path_AccountCreatorErrorLog);
                GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  SignupMultiThreaded() -- ChangeProxy_WebClient() >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs);
            }

            try
            {
                int StartIndex = textUrl.IndexOf("phx-signup-form");
                if (StartIndex > 0)
                {
                    string Start = textUrl.Substring(StartIndex);
                    int EndIndex = Start.IndexOf("name=\"authenticity_token");
                    string End = Start.Substring(0, EndIndex).Replace("phx-signup-form", "").Replace("method=\"POST\"", "").Replace("action=\"https://twitter.com/account/create\"", "");
                    authenticitytoken = End.Replace("class=\"\">", "").Replace("<input type=\"hidden\"", "").Replace("class=\"\">", "").Replace("value=\"", "").Replace("\n", "").Replace("\"", "").Replace(" ", "");
                }
                else
                {
                    Log("[ " + DateTime.Now + " ] => [ Cannot find Authenticity Token On Page ]");
                    nvc.Clear();
                    return nvc;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("2 :" + ex.StackTrace);
                GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- Getting Authenticity --> " + ex.Message, Globals.Path_AccountCreatorErrorLog);
                GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  SignupMultiThreaded() -- Getting Authenticity >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs);
            }

            string postData_SignUp = "user%5Bname%5D=" + username + "&user%5Bemail%5D=" + Email + "&user%5Buser_password%5D=" + Password + "&context=front&authenticity_token=" + authenticitytoken + "";
            string res_PostSignUp = globusHelper.postFormData(new Uri("https://twitter.com/signup"), postData_SignUp, "", "", "", "", "");

            int tempCount_usernameCheckLoop = 0;
            usernameCheckLoop:
            int tempCount_passwordCheckLoop = 0;

            if (username.Contains(" "))
            {
                username = username.Replace(" ", "_");
            }

            string headr = globusHelper.gResponse.Headers.ToString();
            string Usernamecheck = globusHelper.getHtmlfromUrlProxy(new Uri("https://twitter.com/users/username_available?suggest=1&username="******"&full_name=" + name + "&email=&suggest_on_username=true&context=signup"), proxyAddress, proxyPort, proxyUsername, proxyPassword, "https://twitter.com/signup", "");

            //if (EmailCheck.Contains("\"taken\":true")
            //    || res_PostSignUp.Contains("You already have an account with this username and password"))
            //{
            //    Log("Email : " + Email + " has already been taken. An email can only be used on one Twitter account at a time");
            //    Created = false;
            //    GlobusFileHelper.AppendStringToTextfileNewLine(emailData.Replace("\0", ""), Globals.path_EmailAlreadyTaken);
            //}
            //else
            if (Usernamecheck.Contains("Username has already been taken"))
            {
                //Created = false;
                Log("[ " + DateTime.Now + " ] => [ Username : "******" has already been taken ]");
                if (username.Count() > 12)
                {
                    username = username.Remove(8); //Removes the extra characters
                }

                if (UsernameType == "String")
                {
                    Log("[ " + DateTime.Now + " ] => [ Adding String To Username ]");
                    username = username + RandomStringGenerator.RandomString(5);
                }
                else if (UsernameType == "Numbers")
                {
                    Log("[ " + DateTime.Now + " ] => [ Adding Numbers To Username ]");
                    username = username + RandomStringGenerator.RandomNumber(5);
                }
                else
                {
                    Log("[ " + DateTime.Now + " ] => [ Adding Strings & Numbers To Username ]");
                    username = username + RandomStringGenerator.RandomStringAndNumber(5);
                    Log("[ " + DateTime.Now + " ] => [ New user name :- " + username + " ]");
                }

                if (username.Count() > 15)
                {
                    username = username.Remove(13); //Removes the extra characters
                }
                tempCount_usernameCheckLoop++;
                if (tempCount_usernameCheckLoop < 5)
                {
                    goto usernameCheckLoop;
                }
            }
            else if (EmailCheck.Contains("You cannot have a blank email address"))
            {
                Log("[ " + DateTime.Now + " ] => [ Email Address is Blank ]");
                Created = false;
            }

            if (Created)
            {
                nvc.Add("Email", Email);
                nvc.Add("username", username);
                nvc.Add("name", name);
                nvc.Add("Password", Password);
                nvc.Add("authenticitytoken", authenticitytoken);
                nvc.Add("proxyAddress", proxyAddress);
                nvc.Add("proxyPassword", proxyPassword);
                nvc.Add("proxyPort", proxyPort);
                nvc.Add("proxyUsername", proxyUsername);
                nvc.Add("proxyPassword", proxyPassword);
                nvc.Add("capcthavalue", capcthavalue);
                nvc.Add("ImageURL", ImageURL);
                //nvc.Add("globusHelper", globusHelper);
            }

            return nvc;
        }
コード例 #10
0
ファイル: frmMain_NewUI.cs プロジェクト: ahmetDostr/twtboard
        private void btnTestPublicProxy_Click(object sender, EventArgs e)
        {
            CheckNetConn = System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable();

            if (CheckNetConn)
            {
                try
                {
                    workingproxiesCount = 0;
                    AddToProxysLogs("[ " + DateTime.Now + " ] => [ Existing Proxies Saved To : ]");
                    AddToProxysLogs("[ " + DateTime.Now + " ] => [ " + Globals.Path_ExsistingProxies + " ]");
                    List<string> lstProxies = new List<string>();
                    if (chkboxUseUrlProxy.Checked && !string.IsNullOrEmpty(txtProxyUrl.Text))
                    {
                        GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
                        string pageSource = HttpHelper.getHtmlfromUrlProxy(new Uri(txtProxyUrl.Text), "", "", "", "", "");
                        string[] array = Regex.Split(pageSource, "\n");
                        foreach (string item in array)
                        {
                            string Proxy = item.Replace("\r", "");
                            lstProxies.Add(item);
                        }
                    }
                    else if (!string.IsNullOrEmpty(txtPublicProxy.Text.Trim()))
                    {
                        lstProxies = GlobusFileHelper.ReadFiletoStringList(txtPublicProxy.Text);
                    }
                    else
                    {
                        AddToProxysLogs("[ " + DateTime.Now + " ] => [ Please Upload Either Url or Load Proxy Files ]");
                        return;
                    }
                    //lstProxies = Globussoft.GlobusFileHelper.ReadFiletoStringList(txtPublicProxy.Text);
                    AddToProxysLogs("[ " + DateTime.Now + " ] => [ " + lstProxies.Count() + " Public Proxies Uploaded ]");
                    new Thread(() =>
                    {
                        GetValidProxies(lstProxies);
                    }).Start();
                }
                catch (Exception)
                {

                }
            }
            else
            {
                MessageBox.Show("Your Internet Connection is disabled ! or not working, Please Check Your Internet Connection...");
                AddToProxysLogs("[ " + DateTime.Now + " ] => [ Your Internet Connection is disabled ! or not working, Please Check Your Internet Connection... ]");
            }
        }
コード例 #11
0
ファイル: frmMain_NewUI.cs プロジェクト: ahmetDostr/twtboard
        public void AccountCreator(object objemailpass)
        {
            try
            {
                string emailData = (string)objemailpass;

                //emailData = "[email protected]:vAq8YqxSad";

                string[] arr = Regex.Split(emailData, ":");
                string email = string.Empty;
                string pass = string.Empty;

                string proxyAddress = string.Empty;
                string proxyPort = string.Empty;
                string proxyUsername = string.Empty;
                string proxyPassword = string.Empty;

                string username = string.Empty;
                string name = string.Empty;
                string mobileagent = string.Empty;
                string capcthaResponse = "";
                string capcthaChallenge = "";
                string Tweet = "";
                string URl = "";
                string Location = "";
                string Bio = "";

                string proxyItem = string.Empty;

                GlobusHttpHelper HttpHelper = new GlobusHttpHelper();

                lock (lockr_queueRunningProxies_Mobile)
                {
                    if (qRunningProxy_Mobile.Count > 0)
                    {
                        try
                        {
                            proxyItem = qRunningProxy_Mobile.Dequeue();
                        }
                        catch
                        {
                        }
                    }
                    else
                    {
                        CheckAndFillProxyInQueue();
                    }
                }

                if (arr.Length == 2)
                {
                    email = arr[0];
                    pass = arr[1];
                    AddToMobileLogs("[ " + DateTime.Now + " ] => [ Starting Email : " + email + " ]");
                }
                if (arr.Length == 1)
                {
                    return;
                }
                if (arr.Length == 2)
                {
                    email = emailData.Split(':')[0].Replace("\0", "");
                    pass = emailData.Split(':')[1].Replace("\0", "");
                }
                else if (arr.Length == 4)
                {
                    email = emailData.Split(':')[0].Replace("\0", "");
                    pass = emailData.Split(':')[1].Replace("\0", "");
                    proxyAddress = emailData.Split(':')[2];
                    proxyPort = emailData.Split(':')[3];
                }
                else if (arr.Length == 6)
                {
                    email = emailData.Split(':')[0].Replace("\0", "");
                    pass = emailData.Split(':')[1].Replace("\0", "");
                    proxyAddress = emailData.Split(':')[2];
                    proxyPort = emailData.Split(':')[3];
                    proxyUsername = emailData.Split(':')[4];
                    proxyPassword = emailData.Split(':')[5];
                }
                else
                {
                    AddToMobileLogs("[ " + DateTime.Now + " ] => [ " + emailData + " Not In correct Format ]");
                    return;
                }

                if (!string.IsNullOrEmpty(proxyItem))
                {
                    try
                    {
                        proxyAddress = proxyItem.Split(':')[0];
                        proxyPort = proxyItem.Split(':')[1];
                        proxyUsername = proxyItem.Split(':')[2];
                        proxyPassword = proxyItem.Split(':')[3];
                    }
                    catch
                    {
                    }
                }

                if (CountUsername >= lstMobUsername.Count)
                {
                    CountUsername = 0;
                }
                username = lstMobUsername[CountUsername];
                CountUsername++;

                if (CountName >= lstMobName.Count)
                {
                    CountName = 0;
                }
                name = lstMobName[CountName];
                CountName++;

                if (CountMobAgent >= lstMobUserAgent.Count)
                {
                    CountMobAgent = 0;
                }
                mobileagent = lstMobUserAgent[CountMobAgent];
                CountMobAgent++;

                if (CountTweet >= lstMobTweet.Count)
                {
                    CountTweet = 0;
                }
                Tweet = lstMobTweet[CountTweet];
                CountTweet++;

                if (CountUrl >= lstMobUrl.Count)
                {
                    CountUrl = 0;
                }
                URl = lstMobUrl[CountUrl];
                CountUrl++;

                if (CountLocation >= lstMobLocation.Count)
                {
                    CountUrl = 0;
                }
                Location = lstMobLocation[CountLocation];
                CountUrl++;

                if (CountBio >= lstMobBio.Count)
                {
                    CountBio = 0;
                }
                Bio = lstMobBio[CountBio];
                CountBio++;

                int tempCount_usernameCheckLoop = 0;
            usernameCheckLoop:
                string url1 = "https://twitter.com/users/email_available?suggest=1&username=&full_name=&email=" + Uri.EscapeDataString(email.Replace(" ", "")) + "&suggest_on_username=true&context=signup";
                string EmailCheck = HttpHelper.getHtmlfromUrlProxy(new Uri(url1), proxyAddress, proxyPort, proxyUsername, proxyPassword, "https://twitter.com/signup,", "", mobileagent);
                string Usernamecheck = HttpHelper.getHtmlfromUrlProxy(new Uri("https://twitter.com/users/username_available?suggest=1&username="******"&full_name=" + name + "&email=&suggest_on_username=true&context=signup"), proxyAddress, proxyPort, proxyUsername, proxyPassword, "https://twitter.com/signup,", "", mobileagent);

                if (EmailCheck.Contains("Email has already been taken. An email can only be used on one Twitter account at a time"))
                {
                    AddToMobileLogs("[ " + DateTime.Now + " ] => [ Email : " + email + " has already been taken. An email can only be used on one Twitter account at a time ]");
                    return;
                }
                else if (Usernamecheck.Contains("Username has already been taken"))
                {
                    //Created = false;
                    AddToMobileLogs("[ " + DateTime.Now + " ] => [ Username : "******" has already been taken ]");
                    if (username.Count() > 12)
                    {
                        username = username.Remove(8); //Removes the extra characters
                    }

                    if (username.Count() > 15)
                    {
                        username = username.Remove(13); //Removes the extra characters
                    }

                    username = username + RandomStringGenerator.RandomStringAndNumber(5);

                    tempCount_usernameCheckLoop++;
                    if (tempCount_usernameCheckLoop < 5)
                    {
                        goto usernameCheckLoop;
                    }
                }
                else if (EmailCheck.Contains("You cannot have a blank email address"))
                {
                    AddToMobileLogs("[ " + DateTime.Now + " ] => [ You cannot have a blank email address ]");
                }
                AddToMobileLogs("[ " + DateTime.Now + " ] => [ Redirecting To Twitter Signup ]");
                string url = "https://mobile.twitter.com/signup";

                string pagesource1 = HttpHelper.getHtmlfromUrlProxy(new Uri(url), proxyAddress, proxyPort, proxyUsername, proxyPassword, "https://twitter.com/signup,", "", mobileagent);

                string authenticity_token = string.Empty;
                AddToMobileLogs("[ " + DateTime.Now + " ] => [ Getting Captcha Chanllenge ]");

                capcthaChallenge = GetCaptchaMobSrc(capcthaChallenge, pagesource1);

                int tempCaptchaCounter = 0;

            getCaptcha:

                AddToMobileLogs("[ " + DateTime.Now + " ] => [ Getting Authenticity Token ]");

                try
                {
                    int startindex = pagesource1.IndexOf("authenticity_token");
                    string start = pagesource1.Substring(startindex);
                    int endindex = start.IndexOf("\" />");
                    string end = start.Substring(0, endindex).Replace("authenticity_token\" type=\"hidden\" value=\"", "");
                    authenticity_token = end;
                }
                catch (Exception ex)
                {
                    Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> AccountCreator() --> Authenticity token --> " + ex.Message, Globals.Path_ScrapeUsersErroLog);
                }

                #region Captcha Solving

                AddToMobileLogs("[ " + DateTime.Now + " ] => [ Download Captcha Image ]");

                WebClient webclient = new WebClient();
                byte[] args = webclient.DownloadData(capcthaChallenge);
                string[] arr1 = new string[] { BaseLib.Globals.DBCUsername, BaseLib.Globals.DBCPassword, "" };
                AddToMobileLogs("[ " + DateTime.Now + " ] => [ Getting Captcha Response ]");

                DeathByCaptcha.Client clnt = null;
                DeathByCaptcha.Captcha captcha = null;

                capcthaResponse = DecodeDBC(arr1, args, out clnt, out captcha);

                if (string.IsNullOrEmpty(capcthaResponse))
                {
                    Thread.Sleep(1000);
                    capcthaResponse = DecodeDBC(arr1, args, out clnt, out captcha);

                    if (string.IsNullOrEmpty(capcthaResponse))
                    {
                        AddToMobileLogs("[ " + DateTime.Now + " ] => [ Empty Captcha Returned from Decaptcher ]");

                        // Report an incorrectly solved CAPTCHA.
                        // Make sure the CAPTCHA was in fact incorrectly solved, do not
                        // just report it at random, or you might be banned as abuser.
                        if (captcha != null)
                        {
                            if (clnt.Report(captcha))
                            {
                                Console.WriteLine("Reported as incorrectly solved");
                            }
                            else
                            {
                                Console.WriteLine("Failed reporting as incorrectly solved");
                            }
                        }
                        else
                        {
                            AddToMobileLogs("[ " + DateTime.Now + " ] => [ Captcha Null ]");
                        }
                    }
                }

                #endregion

                string postdata = "authenticity_token=" + authenticity_token + "&oauth_signup_client%5Bfullname%5D=" + username + "&oauth_signup_client%5Bphone_number%5D=" + email.Split('@')[0].Replace("+", "%2B") + "%40" + email.Split('@')[1] + "&oauth_signup_client%5Bpassword%5D=" + pass + "&captcha_response_field=" + capcthaResponse + "&captcha_method=2&captcha_challenge_field=" + capcthaChallenge.Replace("https://mobile.twitter.com/signup/captcha/", "").Replace(".gif", "") + "&commit=Sign+up+for+Twitter";
                string pagfinal = HttpHelper.postFormDataMobileData(new Uri("https://mobile.twitter.com/signup"), postdata, "https://mobile.twitter.com/signup", "", "", "", "", mobileagent);
                string pagfinal2 = HttpHelper.getHtmlfromUrlMobile(new Uri("http://mobile.twitter.com/home"), "https://mobile.twitter.com/signup", "", mobileagent);
                #region Tweet

                bool temp_IsCreated = false;

                if (pagfinal.Contains("signout") || pagfinal.Contains("https://mobile.twitter.com/signup/screen_name") || pagfinal.Contains("/signup/screen_name") || !pagfinal2.Contains("http://mobile.twitter.com/welcome/interests"))
                {
                    if (pagfinal.Contains("https://mobile.twitter.com/signup/screen_name"))
                    {
                        string screenName = GlobusHttpHelper.GetParamValue(pagfinal, "settings[screen_name]");
                        string secondPostData = "authenticity_token=" + authenticity_token + "&suggestion=0%3A&settings%5Bscreen_name%5D=" + screenName + "&commit=Continue";
                        string res_secondPost = HttpHelper.postFormDataMobileData(new Uri("https://mobile.twitter.com/signup/screen_name "), secondPostData, "https://mobile.twitter.com/signup/screen_name", "", "", "", "", mobileagent);
                    }

                    AddToMobileLogs("[ " + DateTime.Now + " ] => [ Account Created : " + email + " ]");
                    GlobusFileHelper.AppendStringToTextfileNewLine(email + ":" + pass + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, BaseLib.Globals.Path_MobEmailCreator);
                    int counter_profile = 0;
                profilling:
                    string pageProfileData = HttpHelper.getHtmlfromUrl(new Uri("https://mobile.twitter.com/settings/profile"), "https://mobile.twitter.com/account", "");
                    string postdataProfile = "authenticity_token=" + authenticity_token + "&settings%5Bfullname%5D=" + name + "&settings%5Burl%5D=" + url + "&settings%5Blocation%5D=" + Location + "&settings%5Bdescription%5D=" + Bio + "&commit=Save";
                    string postProfileData = HttpHelper.postFormDataMobileData(new Uri("https://mobile.twitter.com/settings/profile"), postdataProfile, "https://mobile.twitter.com/settings/profile", "", "", "", "", mobileagent);
                    pageProfileData = HttpHelper.getHtmlfromUrl(new Uri("https://mobile.twitter.com/settings/profile"), "https://mobile.twitter.com/account", "");
                    string PostUrl = GlobusHttpHelper.GetParamValue(pageProfileData, "settings[url]");
                    if (!string.IsNullOrEmpty(PostUrl))
                    {
                        AddToMobileLogs("[ " + DateTime.Now + " ] => [ Account :" + email + " Profiled ]");
                        GlobusFileHelper.AppendStringToTextfileNewLine(email + ":" + pass, BaseLib.Globals.Path_MobEmailProfiled);
                    }
                    else
                    {
                        if (counter_profile <= 5)
                        {
                            Thread.Sleep(5000);
                            AddToMobileLogs("[ " + DateTime.Now + " ] => [ Trying Profiling Once Again for Account : " + email + " ]");
                            counter_profile++;
                            goto profilling;

                        }
                        AddToMobileLogs("[ " + DateTime.Now + " ] => [ Account :" + email + " Not Profiled ]");
                        GlobusFileHelper.AppendStringToTextfileNewLine(email + ":" + pass, BaseLib.Globals.Path_NotMobEmailProfiled);
                    }

                    string pagesource3 = HttpHelper.getHtmlfromUrlProxy(new Uri("https://mobile.twitter.com/compose/tweet"), proxyAddress, proxyPort, proxyUsername, proxyPassword, "https://mobile.twitter.com/compose/tweet", "", mobileagent);
                    string TweetPost = "authenticity_token=" + authenticity_token + "&tweet%5Btext%5D=" + Uri.EscapeDataString(Tweet) + "&commit=Tweet";
                    string pagesourcepost = HttpHelper.postFormDataMobileData(new Uri("https://mobile.twitter.com/"), TweetPost, "https://mobile.twitter.com/compose/tweet", "", "", "", "", mobileagent);
                    string secondpagesourcepost = HttpHelper.getHtmlfromUrl(new Uri("https://mobile.twitter.com/"), "https://mobile.twitter.com/", "", mobileagent);

                    if (pagesourcepost.Contains("Tweet sent!") || secondpagesourcepost.Contains("Tweet sent!") || pagesourcepost.Contains(Tweet))
                    {
                        AddToMobileLogs("[ " + DateTime.Now + " ] => [ Tweeted " + Tweet + " From " + email + " ]");
                        GlobusFileHelper.AppendStringToTextfileNewLine(email + ":" + Tweet, BaseLib.Globals.Path_MobTweeted);
                    }
                    else if (secondpagesourcepost.Contains("Whoops! You already tweeted that") || pagesourcepost.Contains("Whoops! You already tweeted that…"))
                    {
                        AddToMobileLogs("[ " + DateTime.Now + " ] => [ You Already Tweeted " + Tweet + " From " + email + " ]");
                        GlobusFileHelper.AppendStringToTextfileNewLine(email + ":" + Tweet, BaseLib.Globals.Path_NotMobEmailTweeted);
                    }
                    else
                    {
                        AddToMobileLogs("[ " + DateTime.Now + " ] => [ Not Tweeted " + Tweet + " From " + email + " ]");
                        GlobusFileHelper.AppendStringToTextfileNewLine(email + ":" + Tweet, BaseLib.Globals.Path_NotMobEmailTweeted);
                    }
                    temp_IsCreated = true;
                    return;
                }
                else if (pagfinal.Contains("Redirecting to: <a href=\"https://mobile.twitter.com/signup/screen_name"))
                {
                    Thread.Sleep(300);
                    pagfinal = HttpHelper.getHtmlfromUrlProxy(new Uri("https://mobile.twitter.com/signup/screen_name"), proxyAddress, proxyPort, proxyUsername, proxyPassword, "https://mobile.twitter.com/compose/tweet", "", mobileagent);
                }
                else if (pagfinal.Contains("captcha invalid-field invalid-captcha-response-field")) //wrong captcha
                {
                    tempCaptchaCounter++;
                    AddToMobileLogs("[ " + DateTime.Now + " ] => [ Wrong Captcha : " + email + " ]");

                    // Report an incorrectly solved CAPTCHA.
                    // Make sure the CAPTCHA was in fact incorrectly solved, do not
                    // just report it at random, or you might be banned as abuser.
                    if (captcha != null)
                    {
                        if (clnt.Report(captcha))
                        {
                            Console.WriteLine("Reported as incorrectly solved");
                        }
                        else
                        {
                            Console.WriteLine("Failed reporting as incorrectly solved");
                        }
                    }

                    if (tempCaptchaCounter <= 3)
                    {
                        capcthaChallenge = GetCaptchaMobSrc("", pagfinal);
                        goto getCaptcha;
                    }
                }

                if (pagfinal.Contains("settings[screen_name]") && !temp_IsCreated)
                {
                    string screenName = GlobusHttpHelper.GetParamValue(pagfinal, "settings[screen_name]");

                    string secondPostData = "authenticity_token=" + authenticity_token + "&suggestion=0%3A&settings%5Bscreen_name%5D=" + screenName + "&commit=Continue";
                    string res_secondPost = HttpHelper.postFormDataMobileData(new Uri("https://mobile.twitter.com/signup/screen_name "), secondPostData, "https://mobile.twitter.com/signup/screen_name", "", "", "", "", mobileagent);

                    #region Profile and tweet

                    AddToMobileLogs("[ " + DateTime.Now + " ] => [ Account Created : " + email + " ]");
                    GlobusFileHelper.AppendStringToTextfileNewLine(email + ":" + pass + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, BaseLib.Globals.Path_MobEmailCreator);
                    int counter_profile = 0;
                profilling:
                    string pageProfileData = HttpHelper.getHtmlfromUrl(new Uri("https://mobile.twitter.com/settings/profile"), "https://mobile.twitter.com/account", "");
                    string postdataProfile = "authenticity_token=" + authenticity_token + "&settings%5Bfullname%5D=" + name + "&settings%5Burl%5D=" + url + "&settings%5Blocation%5D=" + Location + "&settings%5Bdescription%5D=" + Bio + "&commit=Save";
                    string postProfileData = HttpHelper.postFormDataMobileData(new Uri("https://mobile.twitter.com/settings/profile"), postdataProfile, "https://mobile.twitter.com/settings/profile", "", "", "", "", mobileagent);
                    pageProfileData = HttpHelper.getHtmlfromUrl(new Uri("https://mobile.twitter.com/settings/profile"), "https://mobile.twitter.com/account", "");
                    string PostUrl = GlobusHttpHelper.GetParamValue(pageProfileData, "settings[url]");
                    if (!string.IsNullOrEmpty(PostUrl))
                    {
                        AddToMobileLogs("[ " + DateTime.Now + " ] => [ Account :" + email + " Profiled ]");
                        GlobusFileHelper.AppendStringToTextfileNewLine(email + ":" + pass, BaseLib.Globals.Path_MobEmailProfiled);
                    }
                    else
                    {
                        if (counter_profile <= 5)
                        {
                            Thread.Sleep(5000);
                            AddToMobileLogs("[ " + DateTime.Now + " ] => [ Trying Profiling Once Again for Account : " + email + " ]");
                            counter_profile++;
                            goto profilling;

                        }

                        AddToMobileLogs("[ " + DateTime.Now + " ] => [ Account :" + email + " Not Profiled ]");
                        GlobusFileHelper.AppendStringToTextfileNewLine(email + ":" + pass, BaseLib.Globals.Path_NotMobEmailProfiled);
                    }

                    string pagesource3 = HttpHelper.getHtmlfromUrlProxy(new Uri("https://mobile.twitter.com/compose/tweet"), proxyAddress, proxyPort, proxyUsername, proxyPassword, "https://mobile.twitter.com/compose/tweet", "", mobileagent);
                    string TweetPost = "authenticity_token=" + authenticity_token + "&tweet%5Btext%5D=" + Uri.EscapeDataString(Tweet) + "&commit=Tweet";
                    string pagesourcepost = HttpHelper.postFormDataMobileData(new Uri("https://mobile.twitter.com/"), TweetPost, "https://mobile.twitter.com/compose/tweet", "", "", "", "", mobileagent);
                    string secondpagesourcepost = HttpHelper.getHtmlfromUrl(new Uri("https://mobile.twitter.com/"), "https://mobile.twitter.com/", "", mobileagent);
                    if (pagesourcepost.Contains("Tweet sent!") || secondpagesourcepost.Contains("Tweet sent!") || pagesourcepost.Contains(Tweet))
                    {
                        AddToMobileLogs("[ " + DateTime.Now + " ] => [ Tweeted " + Tweet + " From " + email + " ]");
                        GlobusFileHelper.AppendStringToTextfileNewLine(email + ":" + Tweet, BaseLib.Globals.Path_MobTweeted);
                    }
                    else if (secondpagesourcepost.Contains("Whoops! You already tweeted that") || pagesourcepost.Contains("Whoops! You already tweeted that"))
                    {
                        AddToMobileLogs("[ " + DateTime.Now + " ] => [ You Already Tweeted " + Tweet + " From " + email + " ]");
                        GlobusFileHelper.AppendStringToTextfileNewLine(email + ":" + Tweet, BaseLib.Globals.Path_NotMobEmailTweeted);
                    }
                    else
                    {
                        AddToMobileLogs("[ " + DateTime.Now + " ] => [ Not Tweeted " + Tweet + " From " + email + " ]");
                        GlobusFileHelper.AppendStringToTextfileNewLine(email + ":" + Tweet, BaseLib.Globals.Path_NotMobEmailTweeted);
                    }
                    #endregion
                }
                else
                {
                    AddToMobileLogs("[ " + DateTime.Now + " ] => [ Account Not Created : " + email + " ]");
                    GlobusFileHelper.AppendStringToTextfileNewLine(email + ":" + pass, BaseLib.Globals.Path_NotMobEmailCreator);
                }
                #endregion
            }
            catch (Exception ex)
            {
                if (ex.Message == "Unable to connect to remote server")
                {
                    //AddToMobileLogs(ex.Message);
                }
                Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> AccountCreator() --> " + ex.Message, Globals.Path_ScrapeUsersErroLog);
            }
            finally
            {
                counter++;
                if (AccountCounter == counter)
                {
                    MessageBox.Show("Finished Account Creation");
                }
            }
        }
コード例 #12
0
ファイル: frmMain_NewUI.cs プロジェクト: ahmetDostr/twtboard
        private void ThreadMethod_CheckEmails(object parameters)
        {
            try
            {
                Array paramsArray = new object[2];
                paramsArray = (Array)parameters;

                string Email = string.Empty;//"*****@*****.**";

                string proxyAddress = string.Empty;
                string proxyPort = string.Empty;
                string proxyUsername = string.Empty;
                string proxyPassword = string.Empty;

                string emailData = (string)paramsArray.GetValue(0);
                string Proxy = (string)paramsArray.GetValue(1);

                Email = emailData.Split(':')[0];

                if (!string.IsNullOrEmpty(Proxy))
                {
                    try
                    {
                        string[] ProxyData = Proxy.Split(':');
                        if (ProxyData.Count() == 2)
                        {
                            proxyAddress = ProxyData[0];
                            proxyPort = ProxyData[1];
                        }
                        if (ProxyData.Count() == 4)
                        {
                            proxyAddress = ProxyData[0];
                            proxyPort = ProxyData[1];
                            proxyUsername = ProxyData[2];
                            proxyPassword = ProxyData[3];
                        }
                    }
                    catch (Exception)
                    {
                    }
                }
                GlobusHttpHelper gHttpHelpr = new GlobusHttpHelper();

                string res_MainPage = gHttpHelpr.getHtmlfromUrlProxy(new Uri("https://twitter.com/account/resend_password"), "", proxyAddress, proxyPort, proxyUsername, proxyPassword);

                string postAuthenticityToken = TweetAccountManager.PostAuthenticityToken(res_MainPage, "postAuthenticityToken");

                string postData = "authenticity_token=" + postAuthenticityToken + "&email_or_phone=" + Uri.EscapeDataString(Email) + "&screen_name=";

                string postResponse = gHttpHelpr.postFormData(new Uri("https://twitter.com/account/resend_password"), postData, "", "", "", "", "");

                string responseURL = gHttpHelpr.gResponse.ResponseUri.AbsoluteUri;

                responseURL = responseURL.ToLower();

                //if (responseURL.Contains(DateTime.Now + " twitter.com/account/password_reset_sent ]"))
                if (responseURL.Contains("twitter.com/account/password_reset_sent"))
                {
                    //has account
                    GlobusFileHelper.AppendStringToTextfileNewLine(Email, Globals.path_DesktopFolder + "\\ExistingEmail_EmailChecker.txt");
                    AddToListAccountsLogs("[ " + DateTime.Now + " ] => [ Existing Email : " + Email + " ]");
                }
                else if (responseURL.Contains("captcha") || responseURL.Contains("security"))
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine(Email, Globals.path_DesktopFolder + "\\AskingSecurityEmail_EmailChecker.txt");
                    AddToListAccountsLogs("[ " + DateTime.Now + " ] => [ Asking Security with Email : " + Email + " ]");
                }
                else if (responseURL.Contains("twitter.com/account/resend_password") && postResponse.Contains("robots"))
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine(Email, Globals.path_DesktopFolder + "\\TemporarilyLocked_EmailChecker.txt");
                    AddToListAccountsLogs("[ " + DateTime.Now + " ] => [ We've temporarily locked your ability to reset passwords. Please chillax for a few, then try again. : " + Email + " ]");
                }
                else if (postResponse.Contains("प्रतीत होता है की आपने एक अबैध ईमेल पता या फ़ोन नंबर भरा है. कृपया पुनः प्रयास करें.") || postResponse.Contains("It looks like you entered an invalid email address or phone number. Please try again."))
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine(Email, Globals.path_DesktopFolder + "\\TemporarilyLocked_EmailChecker.txt");
                    AddToListAccountsLogs("[ " + DateTime.Now + " ] => [ invalid email address: " + Email + " ]");
                }
                else
                {
                    //no account
                    GlobusFileHelper.AppendStringToTextfileNewLine(Email, Globals.path_DesktopFolder + "\\NonExistingEmail_EmailChecker.txt");
                    AddToListAccountsLogs("[ " + DateTime.Now + " ] => [ NON Existing Email : " + Email + " ]");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
        }
コード例 #13
0
ファイル: frmMain_NewUI.cs プロジェクト: ahmetDostr/twtboard
        private void chkboxImportPublicProxy_CheckedChanged(object sender, EventArgs e)
        {
            try
            {
                if (chkboxImportPublicProxy.Checked)
                {
                    if (chkboxUseUrlProxy.Checked && !string.IsNullOrEmpty(txtProxyUrl.Text))
                    {
                        GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
                        string pageSource = HttpHelper.getHtmlfromUrlProxy(new Uri(txtProxyUrl.Text), "", "", "", "", "");
                        string[] array = Regex.Split(pageSource, "\n");
                        foreach (string item in array)
                        {
                            lstPublicProxyWOTest.Add(item.Replace("\r", ""));
                        }
                    }
                    else if (!string.IsNullOrEmpty(txtPublicProxy.Text))
                    {
                        lstPublicProxyWOTest = GlobusFileHelper.ReadFiletoStringList(txtPublicProxy.Text);
                    }
                    else
                    {
                        AddToProxysLogs("[ " + DateTime.Now + " ] => [ Please Upload Either Url or Load Proxy Files ]");
                        return;
                    }

                    AddToProxysLogs("[ " + DateTime.Now + " ] => [ " + lstPublicProxyWOTest.Count + " Public Proxies Loaded ]");
                    if (lstPublicProxyWOTest.Count > 0)
                    {
                        new Thread(() =>
                        {
                            foreach (string item in lstPublicProxyWOTest)
                            {
                                ImportingProxy(item);
                            }
                        }
                        ).Start();
                    }
                    else
                    {
                        AddToProxysLogs("[ " + DateTime.Now + " ] => [ Sorry No Proxies Available ]");
                    }
                }
            }
            catch (Exception)
            {

            }
        }
コード例 #14
0
        private void StartActionVerifyAccount(ref InstagramUser IgUser)
        {
            lock (this)
            {
                try
                {
                    if (isStopVerifingAccount)
                    {
                        return;
                    }
                    try
                    {
                        listOfWorkingThread.Add(Thread.CurrentThread);
                        listOfWorkingThread = listOfWorkingThread.Distinct().ToList();
                        Thread.CurrentThread.IsBackground = true;
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error ==> " + ex.Message);
                    }

                    if (listOfAccount.Count > 0)
                    {
                        //if (string.IsNullOrEmpty(usernameOfAPI) || string.IsNullOrEmpty(passwordOfAPI))
                        //{
                        //   // GlobusLogHelper.log.Info("Please Enter Username And Password Of API");
                        //}
                        //else
                        {
                            if (string.IsNullOrEmpty(IgUser.proxyport))
                            {
                                IgUser.proxyport = "80";
                            }
                            /// login to Api
                            ///
                            string homePageResponse = IgUser.globusHttpHelper.getHtmlfromUrlProxy(new Uri("https://www.instagram.com/"), IgUser.proxyip, int.Parse(IgUser.proxyport), IgUser.proxyusername, IgUser.proxypassword); //https://www.instagram.com/integrity/checkpoint/?next=%2F

                            string securityCheckPagesource = IgUser.globusHttpHelper.getHtmlfromUrlProxy(new Uri("https://www.instagram.com/integrity/checkpoint/?next=%2F"), IgUser.proxyip, int.Parse(IgUser.proxyport), IgUser.proxyusername, IgUser.proxypassword);


                            if (securityCheckPagesource.Contains("Enter your phone number. We&#39;ll text you a security code to make sure it&#39;s you."))
                            {
startAgain:
                                GlobusHttpHelper objGlobusshttphelper = new GlobusHttpHelper();
                                Queue <string> queueOfMobileNo        = new Queue <string>();
                                Queue <string> queueOfMobileNoUrl     = new Queue <string>();
                                string         MobileNoHomePageSource = objGlobusshttphelper.getHtmlfromUrlProxy(new Uri("http://www.receive-sms-online.info/"), IgUser.proxyip, int.Parse(IgUser.proxyport), IgUser.proxyusername, IgUser.proxypassword);

                                try
                                {
                                    string[] getAllNumberDetails = System.Text.RegularExpressions.Regex.Split(MobileNoHomePageSource, "<a href=");
                                    if (getAllNumberDetails.Count() > 0)
                                    {
                                        foreach (string item in getAllNumberDetails)
                                        {
                                            if (item.Contains("read-sms.php") && item.Contains("Receive SMS USA"))
                                            {
                                                string mobileNo    = string.Empty;
                                                string mobileNourl = string.Empty;

                                                mobileNourl = "http://www.receive-sms-online.info/" + Utils.getBetween(item, "\"", "\"");
                                                mobileNo    = Utils.getBetween(item, "phone=", "\"");
                                                queueOfMobileNoUrl.Enqueue(mobileNourl);
                                                queueOfMobileNo.Enqueue(mobileNo);
                                            }
                                            else
                                            {
                                                continue;
                                            }
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.Message);
                                }

                                if (queueOfMobileNoUrl.Count > 0)
                                {
                                    foreach (string item in queueOfMobileNoUrl)
                                    {
                                        try
                                        {
                                            string phoneNo = queueOfMobileNo.Dequeue();

                                            string getcsrfmiddlewaretoken = Utils.getBetween(securityCheckPagesource, "csrfmiddlewaretoken\" value=\"", "\"");

                                            string phoneNoPostData = "csrfmiddlewaretoken=" + getcsrfmiddlewaretoken + "&phone_number=%2B" + phoneNo;
                                            string postUrl         = "https://www.instagram.com/integrity/checkpoint/?next=%2F";

                                            string smsActivationPagesource = IgUser.globusHttpHelper.postFormDataProxy(new Uri(postUrl), phoneNoPostData, "https://www.instagram.com/integrity/checkpoint/?next=%2F ", "", "https://www.instagram.com", IgUser.proxyip, int.Parse(IgUser.proxyport), IgUser.proxyusername, IgUser.proxypassword);

                                            if (smsActivationPagesource.Contains("Sorry, please choose a different phone number"))
                                            {
                                                continue;
                                            }

                                            var driverervice = PhantomJSDriverService.CreateDefaultService();
                                            driverervice.HideCommandPromptWindow = true;

                                            webDriver = new PhantomJSDriver(driverervice, new PhantomJSOptions());
                                            Thread.Sleep(5000);
                                            webDriver.Navigate().GoToUrl(item);

                                            string pageSource = webDriver.PageSource;
                                            if (string.IsNullOrEmpty(pageSource))
                                            {
                                                webDriver.Navigate().GoToUrl(item);
                                            }
                                            //  webDriver.Close();
                                            // webDriver.Dispose();
                                            string verificationCode = string.Empty;

                                            try
                                            {
                                                string[] getsmsData = System.Text.RegularExpressions.Regex.Split(pageSource, "<td>");
                                                bool     isgotSms   = false;

                                                foreach (string msg in getsmsData)
                                                {
                                                    if (msg.Contains("Instagram account"))
                                                    {
                                                        string smsCode = Utils.getBetween(msg, "</script>", "</td>");
                                                        int    count = 0; int countsms = 0;
                                                        foreach (string data in smsCode.Split(' '))
                                                        {
                                                            string sms = data.Replace(".", "").Replace(",", "");
                                                            System.Text.RegularExpressions.Regex IdCheck = new System.Text.RegularExpressions.Regex("^[0-9]*$");
                                                            if (IdCheck.IsMatch(sms))
                                                            {
                                                                count++;
                                                                if (count == 1)
                                                                {
                                                                    verificationCode = data.Replace(".", "");
                                                                    isgotSms         = true;
                                                                    break;
                                                                }
                                                                else
                                                                {
                                                                    verificationCode = verificationCode + " " + sms;
                                                                    isgotSms         = true;
                                                                    break;
                                                                }
                                                            }
                                                        }
                                                    }
                                                    if (isgotSms)
                                                    {
                                                        break;
                                                    }
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error ==> " + ex.StackTrace);
                                            }

                                            string finalPostData = "csrfmiddlewaretoken=" + getcsrfmiddlewaretoken + "&response_code=" + verificationCode;
                                            string finalPostUrl  = "https://www.instagram.com/integrity/checkpoint/?next=%2F";
                                            string finalresponse = IgUser.globusHttpHelper.postFormDataProxy(new Uri(finalPostUrl), finalPostData, "https://www.instagram.com/integrity/checkpoint/?next=%2F ", "", "https://www.instagram.com", IgUser.proxyip, int.Parse(IgUser.proxyport), IgUser.proxyusername, IgUser.proxypassword);
                                            if (finalresponse.Contains("To verify your account, please enter the security code we texted you"))
                                            {
                                                continue;
                                                // goto startAgain;
                                            }
                                            if (finalresponse.Contains(IgUser.username) && !(finalresponse.Contains("To verify your account, please enter the security code we texted you")))
                                            {
                                                GlobusLogHelper.log.Info(IgUser.username + " Account has been Verified");
                                                break;
                                            }

                                            string homepage = IgUser.globusHttpHelper.getHtmlfromUrlProxy(new Uri("https://www.instagram.com/"), IgUser.proxyip, int.Parse(IgUser.proxyport), IgUser.proxyusername, IgUser.proxypassword);

                                            if (!homepage.Contains("logged-in") && !homepage.Contains(IgUser.username))
                                            {
                                                GlobusLogHelper.log.Info(IgUser.username + " Account is disable");
                                                break;
                                            }
                                            #region Commented to decode Aes Encoded data
                                            //string getSMSPageSource = IgUser.globusHttpHelper.getHtmlfromUrlProxy(new Uri(item), IgUser.proxyip, int.Parse(IgUser.proxyport), IgUser.proxyusername, IgUser.proxypassword);
                                            //string[] getSMS = System.Text.RegularExpressions.Regex.Split(getSMSPageSource, " <tr>");
                                            //getSMS = getSMS.Take(3).ToArray();
                                            //getSMS = getSMS.Skip(1).ToArray();



                                            //foreach(string smsinfo in getSMS)
                                            //{
                                            //    try
                                            //    {
                                            //        if(smsinfo.Contains("<td>"))
                                            //        {
                                            //            string ct = string.Empty;
                                            //            string iv = string.Empty;
                                            //            string s = string.Empty;

                                            //            ct = Utils.getBetween(smsinfo, "ct\":\"", "\"");
                                            //            iv = Utils.getBetween(smsinfo, "iv\":\"", "\"");
                                            //            s = Utils.getBetween(smsinfo, "s\":\"", "\"");

                                            //           string value= DecryptString(ct, "ct");
                                            //          // using (Aes aes = new AesManaged())//RijndaelManaged
                                            //           using (AesManaged aes = new AesManaged())
                                            //           {
                                            //               string text="Happy Propose Day";
                                            //               byte[] rowbyte = Encoding.Unicode.GetBytes(text);

                                            //               byte[] cipherText = null;
                                            //               byte[] plainText = null;
                                            //               byte[] IV=new byte[16];

                                            //               aes.BlockSize = 128;
                                            //               cipherText = Convert.FromBase64String(ct);
                                            //               IV=Convert.FromBase64String(iv);

                                            //               aes.Padding = PaddingMode.None;   //PKCS7
                                            //               aes.KeySize = 128;          // in bits
                                            //               aes.Key = cipherText;  // 16 bytes for 128 bit encryption
                                            //               aes.IV = IV;   // AES needs a 16-byte IV
                                            //               // Should set Key and IV here.  Good approach: derive them from
                                            //               // a password via Cryptography.Rfc2898DeriveBytes



                                            //               using(MemoryStream ms=new MemoryStream())
                                            //               {
                                            //                   using(CryptoStream cs=new CryptoStream(ms,aes.CreateEncryptor(),CryptoStreamMode.Write))
                                            //                   {

                                            //                   }
                                            //               }

                                            //               using (MemoryStream ms = new MemoryStream())
                                            //               {
                                            //                   using (CryptoStream cs = new CryptoStream(ms, aes.CreateDecryptor(), CryptoStreamMode.Write))
                                            //                   {
                                            //                      // cs.Write(cipherText, 0, cipherText.Length);
                                            //                       cs.Write(cipherText, 0, cipherText.Length);
                                            //                   }

                                            //                   plainText = ms.ToArray();
                                            //               }

                                            //               string sms = System.Text.Encoding.Unicode.GetString(plainText);

                                            //               string result = System.Text.Encoding.UTF8.GetString(plainText);

                                            //               result = Encoding.ASCII.GetString(plainText);


                                            //               Console.WriteLine(s);
                                            //           }

                                            //            string sss="";

                                            //        }
                                            //        else
                                            //        {
                                            //            continue;
                                            //        }
                                            //    }
                                            //    catch(Exception ex)
                                            //    {
                                            //        GlobusLogHelper.log.Error("Error : " + ex.Message);
                                            //    }
                                            //}
                                            #endregion
                                        }
                                        catch (Exception ex)
                                        {
                                            GlobusLogHelper.log.Error("Error : " + ex.Message);
                                        }
                                    }
                                }
                            }
                            else if (securityCheckPagesource.Contains(IgUser.username))
                            {
                                GlobusLogHelper.log.Info("Account : " + IgUser.username + " Is Already Verified");
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error("Error : " + ex.Message);
                }
            }
        }
コード例 #15
0
        public void InviteFriendThroughEmail(int NoofemailRequest, int MaxDelay, int MinDelay)
        {
            try
            {
                int   proxyport = 888;
                Regex PortCheck = new Regex("^[0-9]*$");

                if (PortCheck.IsMatch(_ProxyPort) && !string.IsNullOrEmpty(_ProxyPort))
                {
                    proxyport = int.Parse(_ProxyPort);
                }

                string xMESSAGE = string.Empty;
                LoggerManageConnection("[ " + DateTime.Now + " ] => [ Logging In With Account : " + _UserName + " ]");

                if (linkedinLoginAndLogout.LoginHttpHelper(_UserName, _Password, _ProxyAddress, _ProxyPort, _ProxyUserName, _ProxyPassword, ref HttpHelper, ref xMESSAGE))
                {
                    LoggerManageConnection("[ " + DateTime.Now + " ] => [ Logged in with " + _UserName + " ]");
                    //int CounterInvite = 1;

                    if (UniqueEmailStatus == "False")
                    {
                        DataSet ds_bList = new DataSet();
                        foreach (string Email in _lstInviteEmails)
                        {
                            string emailtosend = string.Empty;

                            try
                            {
                                string Querystring = "Select UserID From tb_BlackListAccount Where UserID ='" + Email + "'";
                                ds_bList = DataBaseHandler.SelectQuery(Querystring, "tb_BlackListAccount");
                            }
                            catch { }

                            if (ds_bList.Tables.Count > 0)
                            {
                                if (ds_bList.Tables[0].Rows.Count > 0)
                                {
                                    LoggerManageConnection("[ " + DateTime.Now + " ] => [ User: "******" is Added BalckListed List For Send Connection Pls Check ]");
                                    return;
                                }
                            }
                            else
                            {
                                if (Email.Contains(":"))
                                {
                                    emailtosend = Email.Split(':')[0];
                                }
                                else
                                {
                                    emailtosend = Email;
                                }

                                try
                                {
                                    LoggerManageConnection("[ " + DateTime.Now + " ] => [ Sending Invitation To :" + emailtosend + " ]");

                                    string emailAddresses     = string.Empty;
                                    string csrfToken          = string.Empty;
                                    string sourceAlias        = string.Empty;
                                    string PostData           = string.Empty;
                                    string PgSrcInviteMessgae = string.Empty;
                                    string postUrl            = string.Empty;

                                    // https://www.linkedin.com/fetch/manual-invite-create

                                    PgSrcInviteMessgae = HttpHelper.getHtmlfromUrlProxy(new Uri("https://www.linkedin.com/fetch/importAndInviteEntry"), _ProxyAddress, proxyport, _ProxyUserName, _ProxyPassword);
                                    emailAddresses     = emailtosend;

                                    // For csrfToken
                                    string[] ArrCsrfToken = Regex.Split(PgSrcInviteMessgae, "input");
                                    foreach (string item in ArrCsrfToken)
                                    {
                                        try
                                        {
                                            if (!item.Contains("<!DOCTYPE"))
                                            {
                                                if (item.Contains("csrfToken") && item.Contains("value="))
                                                {
                                                    csrfToken = item;
                                                    break;
                                                }
                                            }
                                        }
                                        catch (Exception ex)
                                        {
                                        }
                                    }
                                    if (csrfToken.Contains("csrfToken"))
                                    {
                                        try
                                        {
                                            csrfToken = csrfToken.Substring(csrfToken.IndexOf("csrfToken"), 44);
                                            string[] Arr = csrfToken.Split('&');
                                            csrfToken = Arr[0].Replace("csrfToken=", string.Empty);
                                            csrfToken = csrfToken.Replace(":", "%3A").Replace("\\", string.Empty).Replace("csrfToken", "").Replace("=", "").Replace("value", "").Replace("\"", "").Trim();
                                        }
                                        catch (Exception ex)
                                        {
                                        }
                                    }

                                    // For sourceAlias
                                    if (PgSrcInviteMessgae.Contains("sourceAlias"))
                                    {
                                        try
                                        {
                                            sourceAlias = PgSrcInviteMessgae.Substring(PgSrcInviteMessgae.IndexOf("sourceAlias"), 100);
                                            string[] Arr = sourceAlias.Split('"');
                                            sourceAlias = Arr[2].Replace("\\", string.Empty).Trim();
                                        }
                                        catch (Exception ex)
                                        {
                                        }
                                    }

                                    //Post Data for Invite Message
                                    PostData = "emailAddresses=" + Uri.EscapeDataString(emailAddresses) + "&subject=Invitation+to+connect+on+LinkedIn&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;
                                    //Post Url for Invite Message

                                    postUrl = "https://www.linkedin.com/fetch/manual-invite-create";

                                    string postResponse = HttpHelper.postFormDataRef(new Uri(postUrl), PostData, "https://www.linkedin.com/fetch/manual-invite-create", "", "", "", "", "");

                                    if (postResponse.Contains("Your invitation has been sent.") && postResponse.Contains("alert success"))
                                    {
                                        LoggerManageConnection("[ " + DateTime.Now + " ] => [ Invitation sent to :" + emailtosend + " from ID : " + _UserName + " ]");
                                        GlobusFileHelper.AppendStringToTextfileNewLine(_UserName + "-->" + emailtosend, Globals.path_AddConnectionEmail);
                                    }
                                    else if (!postResponse.Contains("Your invitation has been sent.") && !postResponse.Contains("alert success"))
                                    {
                                        int Delay = RandomNumberGenerator.GenerateRandom(MinimumDelay, MaximumDelay);
                                        Thread.Sleep(Delay * 1000);
                                        postResponse = HttpHelper.postFormDataRef(new Uri(postUrl), PostData, "https://www.linkedin.com/fetch/manual-invite-create", "", "", "", "", "");
                                        if (postResponse.Contains("Your invitation has been sent.") && postResponse.Contains("alert success"))
                                        {
                                            LoggerManageConnection("[ " + DateTime.Now + " ] => [ Invitation sent to :" + emailtosend + " from ID : " + _UserName + " ]");
                                            GlobusFileHelper.AppendStringToTextfileNewLine(_UserName + "-->" + emailtosend, Globals.path_AddConnectionEmail);
                                        }
                                        else
                                        {
                                            LoggerManageConnection("[ " + DateTime.Now + " ] => [ Invitation sent to :" + emailtosend + " from ID : " + _UserName + " ]");
                                            GlobusFileHelper.AppendStringToTextfileNewLine(_UserName + "-->" + emailtosend, Globals.path_AddConnectionEmail);
                                            //LoggerManageConnection("[ " + DateTime.Now + " ] => [ Some Problem for sending Invitation :" + emailtosend + " from ID : " + _UserName + " ]");
                                            //GlobusFileHelper.AppendStringToTextfileNewLine(_UserName + "-->" + emailtosend, Globals.path_NonAddConnectionEmail);
                                        }
                                    }
                                    else
                                    {
                                        LoggerManageConnection("[ " + DateTime.Now + " ] => [ Invitation sent to :" + emailtosend + " from ID : " + _UserName + " ]");
                                        GlobusFileHelper.AppendStringToTextfileNewLine(_UserName + "-->" + emailtosend, Globals.path_AddConnectionEmail);
                                        //LoggerManageConnection("[ " + DateTime.Now + " ] => [ Some Problem for sending Invitation :" + emailtosend + " from ID : " + _UserName + " ]");
                                        //GlobusFileHelper.AppendStringToTextfileNewLine(_UserName + "-->" + emailtosend, Globals.path_NonAddConnectionEmail);
                                    }

                                    MinimumDelay = MinDelay;
                                    MaximumDelay = MaxDelay;

                                    int Delay1 = RandomNumberGenerator.GenerateRandom(MinimumDelay, MaximumDelay);
                                    LoggerManageConnection("[ " + DateTime.Now + " ] => [ Delay For : " + Delay1 + " Seconds ]");
                                    Thread.Sleep(Delay1 * 1000);
                                }
                                catch (Exception ex)
                                {
                                }
                            }
                        }
                    }
                    else
                    {
                        int counter = 0;

                        while (UsingEmailQueue.Count > 0)
                        {
                            string emailtosend = string.Empty;

                            lock (locker_InvitataionEmail)
                            {
                                if (UsingEmailQueue.Count > 0)
                                {
                                    emailtosend = UsingEmailQueue.Dequeue();
                                    if (listItemTempForInvitation.Contains(emailtosend))
                                    {
                                        continue;
                                    }
                                }

                                else
                                {
                                    LoggerManageConnection("[ " + DateTime.Now + " ] => [ All Loaded Email are used ]");
                                }

                                try
                                {
                                    LoggerManageConnection("[ " + DateTime.Now + " ] => [ Sending Invitation To :" + emailtosend + " from ID : " + _UserName + " ]");

                                    string emailAddresses     = string.Empty;
                                    string csrfToken          = string.Empty;
                                    string sourceAlias        = string.Empty;
                                    string PostData           = string.Empty;
                                    string PgSrcInviteMessgae = string.Empty;
                                    string postUrl            = string.Empty;

                                    // https://www.linkedin.com/fetch/manual-invite-create

                                    PgSrcInviteMessgae = HttpHelper.getHtmlfromUrlProxy(new Uri("https://www.linkedin.com/fetch/importAndInviteEntry"), _ProxyAddress, proxyport, _ProxyUserName, _ProxyPassword);
                                    emailAddresses     = emailtosend.Replace("@", "%40");

                                    // For csrfToken
                                    string[] ArrCsrfToken = Regex.Split(PgSrcInviteMessgae, "input");
                                    foreach (string item in ArrCsrfToken)
                                    {
                                        try
                                        {
                                            if (!item.Contains("<!DOCTYPE"))
                                            {
                                                if (item.Contains("csrfToken") && item.Contains("value="))
                                                {
                                                    csrfToken = item;
                                                    break;
                                                }
                                            }
                                        }
                                        catch (Exception ex)
                                        {
                                        }
                                    }
                                    if (csrfToken.Contains("csrfToken"))
                                    {
                                        try
                                        {
                                            csrfToken = csrfToken.Substring(csrfToken.IndexOf("csrfToken"), 40);
                                            string[] Arr = csrfToken.Split('&');
                                            csrfToken = Arr[0].Replace("csrfToken=", string.Empty);
                                            csrfToken = csrfToken.Replace(":", "%3A").Replace("\\", string.Empty).Trim();;
                                        }
                                        catch (Exception ex)
                                        {
                                        }
                                    }

                                    // For sourceAlias
                                    if (PgSrcInviteMessgae.Contains("sourceAlias"))
                                    {
                                        try
                                        {
                                            sourceAlias = PgSrcInviteMessgae.Substring(PgSrcInviteMessgae.IndexOf("sourceAlias"), 100);
                                            string[] Arr = sourceAlias.Split('"');
                                            sourceAlias = Arr[2].Replace("\\", string.Empty).Trim();
                                        }
                                        catch (Exception ex)
                                        {
                                        }
                                    }

                                    //Post Data for Invite Message
                                    // emailAddresses=adanu%40femail.com%2Cagantuk%40gmail.com%2C&subject=Invitation+to+connect+on+LinkedIn&csrfToken=ajax%3A3731156693650115835&sourceAlias=0_7MU6tu3FMvMnMAXccRg8dcLvCi6FWQRq-jJrq2WCIlH
                                    PostData = "emailAddresses=" + emailAddresses + "&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;

                                    //Post Url for Invite Message
                                    postUrl = "https://www.linkedin.com/fetch/manual-invite-create";

                                    //Post Response
                                    string postResponse = HttpHelper.postFormDataRef(new Uri(postUrl), PostData, "https://www.linkedin.com/fetch/manual-invite-create", "", "", "", "", "");

                                    if (postResponse.Contains("One invitation has been sent.") && postResponse.Contains("alert success"))
                                    {
                                        LoggerManageConnection("[ " + DateTime.Now + " ] => [ Invitation sent to :" + emailtosend + " from ID : " + _UserName);
                                        GlobusFileHelper.AppendStringToTextfileNewLine(_UserName + "-->" + emailtosend, Globals.path_AddConnectionEmail);
                                    }
                                    else
                                    {
                                        LoggerManageConnection("[ " + DateTime.Now + " ] => [ Invitation sent to :" + emailtosend + " from ID : " + _UserName);
                                        GlobusFileHelper.AppendStringToTextfileNewLine(_UserName + "-->" + emailtosend, Globals.path_AddConnectionEmail);
                                        //LoggerManageConnection("[ " + DateTime.Now + " ] => [ Some Problem for sending Invitation :" + emailtosend + " from ID : " + _UserName + " ]");
                                        //GlobusFileHelper.AppendStringToTextfileNewLine(_UserName + "-->" + emailtosend, Globals.path_NonAddConnectionEmail);
                                    }
                                    counter = counter + 1;

                                    MinimumDelay = MinDelay;
                                    MaximumDelay = MaxDelay;

                                    int Delay = RandomNumberGenerator.GenerateRandom(MinimumDelay, MaximumDelay);
                                    LoggerManageConnection("[ " + DateTime.Now + " ] => [ Delay For : " + Delay + " Seconds ]");
                                    Thread.Sleep(Delay * 1000);
                                    listItemTempForInvitation.Add(emailtosend);
                                }
                                catch (Exception ex)
                                {
                                }
                            }
                        }
                    }
                }
                else
                {
                    LoggerManageConnection("[ " + DateTime.Now + " ] => [ " + xMESSAGE + " With Username >>> " + _UserName + " ]");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
コード例 #16
0
        public void EndorsingPeople(ref GlobusHttpHelper HttpHelper, string UserId)
        {
            try
            {
                int count     = 0;
                int ProxyPort = 0;
                if (!string.IsNullOrEmpty(proxyPort) && NumberHelper.ValidateNumber(proxyPort))
                {
                    ProxyPort = Convert.ToInt32(proxyPort);
                }

                string EndorseLink       = string.Empty;
                string modelNo           = string.Empty;
                string csrfToken         = string.Empty;
                string postdata          = string.Empty;
                string _ed               = string.Empty;
                string endorseUrl        = string.Empty;
                string Link              = string.Empty;
                string LinkSource        = string.Empty;
                string PageSourceProfile = string.Empty;

                try
                {
                    Globals.tempDict.Add(UserId, "");
                    Log("[ " + DateTime.Now + " ] => [ Starting Getting Member Details For User Id Link - :" + UserId + " With : " + Username + " ]");
                }
                catch
                {
                }


                if (!UserId.Contains("http"))
                {
                    Link = "http://www.linkedin.com/people/conn-details?i=&contactMemberID=" + UserId;

                    PageSourceProfile = HttpHelper.getHtmlfromUrlProxy(new Uri(Link), proxyAddress, 0, proxyUsername, proxyPassword);

                    try
                    {
                        int startindex = PageSourceProfile.IndexOf("/profile/view?id=");
                        if (startindex > 0)
                        {
                            string start    = PageSourceProfile.Substring(startindex);
                            int    endIndex = start.IndexOf("\">");
                            string end      = start.Substring(0, endIndex).Replace("\\", "").Replace("&amp;", "&");

                            if (end.Contains("&trk"))
                            {
                                end = end.Split('&')[0].ToString();
                            }

                            LinkSource = "http://www.linkedin.com" + end;
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error -->EndorsingPeople() --> LinkSource >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                        GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> EndorsingPeople() --> LinkSource >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.path_EndorsePeople);
                    }

                    if (string.IsNullOrEmpty(UserId))
                    {
                        try
                        {
                            Globals.tempDict.Add(UserId, "");
                            Log("[ " + DateTime.Now + " ] => [ Cannot Find Data For Userid : " + UserId + " From " + Username + " ]");
                            return;
                        }
                        catch
                        { }
                    }

                    PageSourceProfile = HttpHelper.getHtmlfromUrlProxy(new Uri(LinkSource), proxyAddress, 0, proxyUsername, proxyPassword);
                }
                else
                {
                    Link = UserId;

                    PageSourceProfile = HttpHelper.getHtmlfromUrlProxy(new Uri(Link), proxyAddress, 0, proxyUsername, proxyPassword);
                }



                if (PageSourceProfile.Contains("csrfToken"))
                {
                    csrfToken = PageSourceProfile.Substring(PageSourceProfile.IndexOf("csrfToken"), 100);
                    string[] Arr = csrfToken.Split('&');

                    try
                    {
                        csrfToken = Arr[0].Replace("csrfToken=", "").Replace("\\", "");
                        csrfToken = csrfToken.Split('>')[0].Replace(">", string.Empty).Replace("\"", string.Empty);
                    }
                    catch (Exception ex)
                    {
                        csrfToken = Arr[0].Replace("csrfToken=", "").Replace("\\", "");
                    }
                    //csrfToken
                    if (csrfToken.Contains("updateTagsUrl"))
                    {
                        csrfToken = csrfToken.Split(',')[0].ToString();
                    }
                }


                Dictionary <string, string> lstskilldata = new Dictionary <string, string>();
                if (PageSourceProfile.Contains("/profile/unendorse?_ed="))
                {
                    _ed = Utils.getBetween(PageSourceProfile, "/profile/unendorse?_ed=", "&");
                }
                if (PageSourceProfile.Contains("endorseURL:"))
                {
                    endorseUrl = Utils.getBetween(PageSourceProfile, "endorseURL:", ",").Replace("\\", "").Replace("'", "").Trim();
                    endorseUrl = "https://www.linkedin.com" + endorseUrl;
                }

                try
                {
                    string[] arr = Regex.Split(PageSourceProfile, "fmt__skill_name\":");
                    arr = arr.Skip(1).ToArray();
                    foreach (string item in arr)
                    {
                        string SkillName = string.Empty;
                        string SkillId   = string.Empty;
                        if (!item.Contains("viewerEndorsementId\":"))
                        {
                            if (item.Contains("id\":"))
                            {
                                SkillName = Utils.getBetween(item, "", ",").Replace("\\u002d", "-").Replace("\"", "").Replace(",", "").Replace("&amp;", "&").Replace("}", "").Trim();
                                //SkillId = Utils.getBetween(item, "id\":", ",").Replace("\"", "").Replace(",", "").Replace("&amp;", "&").Replace("}", "").Replace("\u002d", "-").Trim();
                                lstskilldata.Add(SkillName, SkillName);
                            }
                        }
                    }
                    if (lstskilldata.Count == 0)
                    {
                        arr = Regex.Split(PageSourceProfile, "data-endorsed-item-name=\"");
                        arr = arr.Skip(1).ToArray();

                        foreach (string item in arr)
                        {
                            if (EndorsePeople.no_of_Skils == lstskilldata.Count)
                            {
                                if (EndorsePeople.no_of_Skils == 0 && lstskilldata.Count == 0)
                                {
                                }
                                else
                                {
                                    break;
                                }
                            }
                            string SkillName = string.Empty;
                            string SkillId   = string.Empty;
                            if (!item.Contains("endorse-item has-endorsements endorsed-by-viewer"))
                            {
                                //if (item.Contains("id\":"))
                                {
                                    SkillName = Utils.getBetween(item, "", "\"").Replace("\\u002d", "-").Replace("\"", "").Replace(",", "").Replace("&amp;", "&").Replace("}", "").Trim();
                                    //SkillId = Utils.getBetween(item, "id\":", ",").Replace("\"", "").Replace(",", "").Replace("&amp;", "&").Replace("}", "").Replace("\u002d", "-").Trim();
                                    lstskilldata.Add(SkillName, SkillName);
                                }
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error -->EndorsingPeople() --> lstskilldata Data  >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> EndorsingPeople() --> lstskilldata Data >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.path_EndorsePeople);
                }

                try
                {
                    string _UserId = string.Empty;

                    if (lstskilldata.Count > 0)
                    {
                        foreach (KeyValuePair <string, string> item in lstskilldata)
                        {
                            if (count > 4)
                            {
                                return;
                            }
                            if (!UserId.Contains("http"))
                            {
                                _UserId = UserId;
                            }
                            else
                            {
                                _UserId = Utils.getBetween(UserId + "@", "&id=", "@");
                                if (string.IsNullOrEmpty(_UserId))
                                {
                                    _UserId = Utils.getBetween(UserId + "@", "?id=", "@");
                                }
                                //_UserId = UserId.Substring(UserId.IndexOf("&id=")).Replace("&id=", string.Empty);
                            }

                            postdata = "endorsementCount=1&recipientId-0=" + _UserId + "&recipientType-0=member&endorsedItemName-0=" + Uri.EscapeDataString(item.Key) + "&endorsementId-0=&endorserIds-0=";
                            string PostUrl = "http://www.linkedin.com/profile/endorse?csrfToken=" + csrfToken + "&_ed=" + _ed + "&goback=%2Enpv_" + UserId + "_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_contacts*5contacts*5list*5contact*4name*50_*1";

                            string PostPageSource = HttpHelper.postFormDataRef(new Uri(endorseUrl), postdata, LinkSource, "", "", "", "", "1");

                            if (!PostPageSource.Contains("fail") || !PostPageSource.Contains("failure"))
                            {
                                string[] ArrayPostedData = System.Text.RegularExpressions.Regex.Split(PostPageSource, "}");
                                //ArrayPostedData = ArrayPostedData.Skip(1).ToArray();
                                foreach (string itemdata in ArrayPostedData)
                                {
                                    foreach (KeyValuePair <string, string> item1 in lstskilldata)
                                    {
                                        if (itemdata.Contains(item1.Key))
                                        {
                                            string status = string.Empty;
                                            try
                                            {
                                                //int startindex = itemdata.IndexOf("endorsementStatus\":\"");
                                                int startindex = PostPageSource.IndexOf("status");
                                                if (startindex >= 0)
                                                {
                                                    //string start = itemdata.Substring(startindex).Replace("endorsementStatus\":\"", "");
                                                    //int endIndex = start.IndexOf("\",\"");
                                                    //string end = start.Substring(0, endIndex).Replace("&amp;", "&");
                                                    //status = end;

                                                    string start    = PostPageSource.Substring(startindex).Replace("status", "");
                                                    int    endIndex = start.IndexOf("}");
                                                    string end      = start.Substring(0, endIndex).Replace("\"", string.Empty).Replace(":", string.Empty);
                                                    status = end;

                                                    string CSVHeader   = "UserID" + "," + "Skill" + "," + "Status" + "," + "EndorseID"; //New Addedd
                                                    string CSV_Content = Username + "," + item1.Key + "," + status + "," + UserId;      //new adde
                                                    CSVUtilities.ExportDataCSVFile(CSVHeader, CSV_Content, Globals.path_EndorsedPeopleText);
                                                    Log("[ " + DateTime.Now + " ] => [ Status For Skill : " + item1.Key + " ==> " + status + " ]");
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error -->EndorsingPeople() --> PostPageSource posted correct >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                                                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> EndorsingPeople() --> PostPageSource posted correct >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.path_EndorsePeople);
                                            }
                                        }
                                    }
                                }
                            }
                            else
                            {
                                string CSVHeader   = "UserID" + "," + "Status" + "," + "EndorseID";
                                string CSV_Content = Username + "," + "Failure" + "," + UserId;
                                CSVUtilities.ExportDataCSVFile(CSVHeader, CSV_Content, Globals.path_NotEndorsedPeopleText);
                                GlobusFileHelper.AppendStringToTextfileNewLine(Username + ",Failure", Globals.path_NotEndorsedPeopleText);
                                Log("[ " + DateTime.Now + " ] => [ Failure for User id : " + item.Key + " -> " + _UserId + " ]");
                            }
                            count++;
                        }
                    }
                    else
                    {
                        Log("[ " + DateTime.Now + " ] => [ No skills found for User id " + _UserId + " ]");
                    }
                }
                catch (Exception ex)
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error -->EndorsingPeople() --> postdata  >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> EndorsingPeople() --> postdata >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.path_EndorsePeople);
                }
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> EndorsingPeople() --> Full Data >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> EndorsingPeople() --> Full Data >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.path_EndorsePeople);
            }
        }
コード例 #17
0
ファイル: TwitterSignUp.cs プロジェクト: ahmetDostr/twtboard
        public void SignupMultiThreaded(object parameters)
        {
            try
            {

                Thread.CurrentThread.IsBackground = true;

                string DBCUsername = BaseLib.Globals.DBCUsername;
                string DBCPAssword = BaseLib.Globals.DBCPassword;
                GlobusHttpHelper globusHelper = new GlobusHttpHelper();
                int CaptchaCounter = 0;
                int counter_AuthToken = 0;
                string ImageURL = string.Empty;
                string authenticitytoken = string.Empty;
                string capcthavalue = string.Empty;

                Array paramsArray = new object[4];
                paramsArray = (Array)parameters;

                string Email = string.Empty;//"*****@*****.**";
                string Password = string.Empty;//"1JESUS11";

                string proxyAddress = string.Empty;
                string proxyPort = string.Empty;
                string proxyUsername = string.Empty;
                string proxyPassword = string.Empty;

                string emailData = (string)paramsArray.GetValue(0);
                string username = (string)paramsArray.GetValue(1);
                string name = (string)paramsArray.GetValue(2);
                string Proxy = (string)paramsArray.GetValue(3);
                try
                {
                    //Log("test - " + emailData + " :: " + name);

                    #region Emails & Proxy Settings
                    try
                    {
                        int Count = emailData.Split(':').Length;
                        if (Count == 1)
                        {
                            Log("[ " + DateTime.Now + " ] => [ Uploaded Emails Not In correct Format ]");
                            Log(emailData);
                            return;
                        }
                        if (Count == 2)
                        {
                            Email = emailData.Split(':')[0].Replace("\0", "");
                            Password = emailData.Split(':')[1].Replace("\0", "");
                        }
                        else if (Count == 4)
                        {
                            Email = emailData.Split(':')[0].Replace("\0", "");
                            Password = emailData.Split(':')[1].Replace("\0", "");
                            proxyAddress = emailData.Split(':')[2];
                            proxyPort = emailData.Split(':')[3];
                        }
                        else if (Count == 6)
                        {
                            Email = emailData.Split(':')[0].Replace("\0", "");
                            Password = emailData.Split(':')[1].Replace("\0", "");
                            proxyAddress = emailData.Split(':')[2];
                            proxyPort = emailData.Split(':')[3];
                            proxyUsername = emailData.Split(':')[4];
                            proxyPassword = emailData.Split(':')[5];
                        }
                        else
                        {
                            Log("[ " + DateTime.Now + " ] => [ Uploaded Emails Not In correct Format ]");
                            Log(emailData);
                            return;
                        }
                    }
                    catch (Exception ex)
                    {
                        //Console.WriteLine("8 :" + ex.StackTrace);
                        GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- Email Pass --> " + ex.Message, Globals.Path_AccountCreatorErrorLog);
                        GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  SignupMultiThreaded() -- Email Pass >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs);
                    }

                    try
                    {
                        RaiseEvent_AddToDictionary(Email);
                        dictionary_Threads.Add("AccountCreator_" + Email, Thread.CurrentThread);
                    }
                    catch (Exception ex) { Console.WriteLine(ex.StackTrace); }

                    try
                    {
                        if (Proxy.Split(':').Length == 4)
                        {
                            proxyAddress = Proxy.Split(':')[0];
                            proxyPort = Proxy.Split(':')[1];
                            proxyUsername = Proxy.Split(':')[2];
                            proxyPassword = Proxy.Split(':')[3];
                        }
                    }
                    catch (Exception ex)
                    {
                        //Console.WriteLine("7 :" + ex.StackTrace);
                        GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- Proxy Split --> " + ex.Message, Globals.Path_AccountCreatorErrorLog);
                        GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  SignupMultiThreaded() -- Proxy Split >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs);
                    }

                    #endregion

                    try
                    {
                        username = username.Replace("\0", "");
                        Password = Password.Replace("\0", "");
                        if (!(username.Count() < 15 || Password.Count() > 6))
                        {
                            if (username.Count() > 15)
                            {
                                Log("[ " + DateTime.Now + " ] => [ Username Must Not be greater than 15 character ]");
                                username = username.Remove(13); //Removes the extra characters
                            }
                            else if (Password.Count() < 6)
                            {
                                Log("[ " + DateTime.Now + " ] => [ Password Must Not be less than 6 character ]");
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        //Console.WriteLine("6 :" + ex.StackTrace);
                        GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- Check Username --> " + ex.Message, Globals.Path_AccountCreatorErrorLog);
                        GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  SignupMultiThreaded() -- Check Username >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs);
                    }

                StartAgain:

                    Random randm = new Random();
                    double cachestop = randm.NextDouble();
                    string pagesourceGoogleCaptcha = string.Empty;
                    string signUpPage = string.Empty;
                    try
                    {
                        try
                        {
                            signUpPage = globusHelper.getHtmlfromUrlProxy(new Uri("https://twitter.com/signup"), proxyAddress, proxyPort, proxyUsername, proxyPassword, "", "");
                        }
                        catch (Exception ex)
                        {
                            Log("[ " + DateTime.Now + " ] => [ Error in Loading sign up page  " + proxyAddress + " Exception" + ex.Message + " ]");
                        }
                        if (string.IsNullOrEmpty(signUpPage))
                        {
                            Thread.Sleep(500);
                            signUpPage = globusHelper.getHtmlfromUrlProxy(new Uri("https://twitter.com/signup"), proxyAddress, proxyPort, proxyUsername, proxyPassword, "", "");
                        }

                        //Check if captchaAvailable, if yes, hit google captcha url
                        if (!string.IsNullOrEmpty(signUpPage) && signUpPage.Contains("captchaAvailable&quot;:true"))
                        {
                            try
                            {
                                string pagesource1 = globusHelper.getHtmlfromUrlProxy(new Uri("https://www.google.com/recaptcha/api/js/recaptcha_ajax.js"), proxyAddress, proxyPort, proxyUsername, proxyPassword, "", "");
                            }
                            catch { }
                            try
                            {
                                pagesourceGoogleCaptcha = globusHelper.getHtmlfromUrlProxy(new Uri("https://www.google.com/recaptcha/api/challenge?k=6LfbTAAAAAAAAE0hk8Vnfd1THHnn9lJuow6fgulO&ajax=1&cachestop=" + cachestop + "&lang=en"), proxyAddress, proxyPort, proxyUsername, proxyPassword, "", "");
                            }
                            catch { }
                            if (string.IsNullOrEmpty(pagesourceGoogleCaptcha))
                            {
                                Thread.Sleep(500);
                                pagesourceGoogleCaptcha = globusHelper.getHtmlfromUrlProxy(new Uri("https://www.google.com/recaptcha/api/challenge?k=6LfbTAAAAAAAAE0hk8Vnfd1THHnn9lJuow6fgulO&ajax=1&cachestop=" + cachestop + "&lang=en"), proxyAddress, proxyPort, proxyUsername, proxyPassword, "", "");
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        pagesourceGoogleCaptcha = string.Empty;
                        Log("[ " + DateTime.Now + " ] => [ Error in Loading sign up page  " + proxyAddress + " Exception" + ex.Message + " ]");
                    }

                    if (string.IsNullOrEmpty(signUpPage))
                    {
                        NoOfNonCreatedAccounts++;
                        NoOfNonCreatedAccountsProxy++;
                        Log("[ " + DateTime.Now + " ] => [ Couldn't load Sign Up Page: " + Email + " ]");
                        lock (Lock_notCreatedaccounts)
                        {
                            GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.path_FailedCreatedAccounts);
                            GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password, Globals.path_FailedCreatedAccountsOnlyEmailPass);
                            GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password, Globals.path_FailedCreatedAccountsOnlyEmailPass);
                        }

                        Globals.EnquequeDataForSignUp(new object[] { emailData, username, name, Proxy });

                        return;
                    }

                    //if captchaAvailable on signup but google captcha page source is null, retry getting captcha page source
                    if (string.IsNullOrEmpty(pagesourceGoogleCaptcha) && signUpPage.Contains("captchaAvailable&quot;:true"))
                    {
                        try
                        {
                            Thread.Sleep(500);
                            //textUrl = globusHelper.getHtmlfromUrlProxy(new Uri("https://twitter.com/signup"), proxyAddress, proxyPort, proxyUsername, proxyPassword, "", "");
                            string pagesource1 = globusHelper.getHtmlfromUrlProxy(new Uri("https://www.google.com/recaptcha/api/js/recaptcha_ajax.js"), proxyAddress, proxyPort, proxyUsername, proxyPassword, "", "");
                            pagesourceGoogleCaptcha = globusHelper.getHtmlfromUrlProxy(new Uri("https://www.google.com/recaptcha/api/challenge?k=6LfbTAAAAAAAAE0hk8Vnfd1THHnn9lJuow6fgulO&ajax=1&cachestop=" + cachestop + "&lang=en"), proxyAddress, proxyPort, proxyUsername, proxyPassword, "", "");
                        }
                        catch (Exception ex)
                        {
                            if (CaptchaCounter == 0)//retry getting captcha page source only once
                            {
                                Log("[ " + DateTime.Now + " ] => [ Finding CAPTCHA Again For " + Email + " ]");
                                CaptchaCounter++;
                                goto StartAgain;
                            }
                            Console.WriteLine("Captcha Not Found For Email : " + Email + " : Error :" + ex.StackTrace);
                            GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- Getting Signup PageSource --> " + ex.Message, Globals.Path_AccountCreatorErrorLog);
                            GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  SignupMultiThreaded() -- Getting Signup PageSource >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs);
                        }
                    }

                    try
                    {
                        int IndexStart = pagesourceGoogleCaptcha.IndexOf("challenge :");
                        if (IndexStart > 0)
                        {
                            string Start = pagesourceGoogleCaptcha.Substring(IndexStart);
                            int IndexEnd = Start.IndexOf("',");
                            string End = Start.Substring(0, IndexEnd).Replace("challenge :", "").Replace("'", "").Replace(" ", "");
                            capcthavalue = End;
                            ImageURL = "https://www.google.com/recaptcha/api/image?c=" + End;
                        }
                        else
                        {
                            if (signUpPage.Contains("captchaAvailable&quot;:true"))
                            {
                                if (CaptchaCounter == 0)
                                {
                                    Log("[ " + DateTime.Now + " ] => [ Finding Capctha Again For " + Email + " ]");
                                    CaptchaCounter++;
                                    goto StartAgain;
                                }
                                Log("[ " + DateTime.Now + " ] => [ Cannot Find challenge Captcha on Page. Email : Password --> " + Email + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword + " ]");
                                GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.Path_CaptchaRequired);
                                //return;
                            }

                        }
                    }
                    catch (Exception ex)
                    {
                        //Console.WriteLine("1 :" + ex.StackTrace);
                        GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- Getting Image Url --> " + ex.Message, Globals.Path_AccountCreatorErrorLog);
                        GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  SignupMultiThreaded() -- Getting Image Url >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs);
                    }

                    WebClient webclient = new WebClient();
                    try
                    {
                        int intProxyPort = 80;
                        if (!string.IsNullOrEmpty(proxyPort) && GlobusRegex.ValidateNumber(proxyPort))
                        {
                            intProxyPort = int.Parse(proxyPort);
                        }
                        ChangeProxy_WebClient(proxyAddress, intProxyPort, proxyUsername, proxyPassword, ref webclient);
                    }
                    catch (Exception ex)
                    {
                        GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- ChangeProxy_WebClient() --> " + ex.Message, Globals.Path_AccountCreatorErrorLog);
                        GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  SignupMultiThreaded() -- ChangeProxy_WebClient() >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs);
                    }

                    try
                    {
                        int StartIndex = signUpPage.IndexOf("phx-signup-form");
                        if (StartIndex > 0)
                        {
                            string Start = signUpPage.Substring(StartIndex);
                            int EndIndex = Start.IndexOf("name=\"authenticity_token");
                            string End = Start.Substring(0, EndIndex).Replace("phx-signup-form", "").Replace("method=\"POST\"", "").Replace("action=\"https://twitter.com/account/create\"", "");
                            authenticitytoken = End.Replace("class=\"\">", "").Replace("<input type=\"hidden\"", "").Replace("class=\"\">", "").Replace("value=\"", "").Replace("\n", "").Replace("\"", "").Replace(" ", "");
                        }
                        else
                        {
                            //Log("Cannot find Authenticity Token On Page for : " + Email);
                            if (counter_AuthToken == 0)
                            {
                                Log("[ " + DateTime.Now + " ] => [ Retrying for Authenticity Token for : " + Email + " ]");
                                goto StartAgain;
                            }
                            else
                            {
                                Log("[ " + DateTime.Now + " ] => [ Cannot find Authenticity Token On Page, Exiting for : " + Email + " ]");
                                //Log("Couldn't create Account with : " + Email);
                                lock (Lock_notCreatedaccounts)
                                {
                                    GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.path_FailedCreatedAccounts);
                                    GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password, Globals.path_FailedCreatedAccountsOnlyEmailPass);
                                }

                                Globals.EnquequeDataForSignUp(new object[] { emailData, username, name, Proxy });

                                return;
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        //Console.WriteLine("2 :" + ex.StackTrace);
                        GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- Getting Authenticity --> " + ex.Message, Globals.Path_AccountCreatorErrorLog);
                        GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  SignupMultiThreaded() -- Getting Authenticity >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs);
                    }
                    ////Posting data
                    try
                    {
                        //Sign Up
                        string postData_SignUp = "user%5Bname%5D=" + username + "&user%5Bemail%5D=" + Uri.EscapeDataString(Email) + "&user%5Buser_password%5D=" + Password + "&context=front&authenticity_token=" + authenticitytoken + "";
                        string res_PostSignUp = globusHelper.postFormData(new Uri("https://twitter.com/signup"), postData_SignUp, "", "", "", "", "");

                        int tempCount_usernameCheckLoop = 0;
                    usernameCheckLoop:
                        int tempCount_passwordCheckLoop = 0;

                        bool Created = true;
                        string url = "https://twitter.com/users/email_available?suggest=1&username=&full_name=&email=" + Uri.EscapeDataString(Email.Replace(" ", "")) + "&suggest_on_username=true&context=signup";
                        string EmailCheck = globusHelper.getHtmlfromUrlProxy(new Uri(url), proxyAddress, proxyPort, proxyUsername, proxyPassword, "https://twitter.com/signup", "");
                        string Usernamecheck = globusHelper.getHtmlfromUrlProxy(new Uri("https://twitter.com/users/username_available?suggest=1&username="******"&full_name=" + name + "&email=&suggest_on_username=true&context=signup"), proxyAddress, proxyPort, proxyUsername, proxyPassword, "https://twitter.com/signup", "");

                        if (EmailCheck.Contains("Email has already been taken. An email can only be used on one Twitter account at a time")
                            || (res_PostSignUp.Contains("You already have an account with this username and password")))
                        {
                            Log("[ " + DateTime.Now + " ] => [ Email : " + Email + " has already been taken. An email can only be used on one Twitter account at a time ]");
                            GlobusFileHelper.AppendStringToTextfileNewLine(emailData.Replace("\0", ""), Globals.path_EmailAlreadyTaken);
                            Created = false;
                        }
                        else if (Usernamecheck.Contains("Username has already been taken"))
                        {
                            //Created = false;
                            Log("[ " + DateTime.Now + " ] => [ Username : "******" has already been taken ]");
                            if (username.Count() > 12)
                            {
                                username = username.Remove(8); //Removes the extra characters
                            }

                            if (UsernameType == "String")
                            {
                                Log("[ " + DateTime.Now + " ] => [ Adding String To Username ]");
                                username = username + RandomStringGenerator.RandomString(5);
                            }
                            else if (UsernameType == "Numbers")
                            {
                                Log("[ " + DateTime.Now + " ] => [ Adding Numbers To Username ]");
                                username = username + RandomStringGenerator.RandomNumber(5);
                            }
                            else
                            {
                                Log("[ " + DateTime.Now + " ] => [ Adding Strings & Numbers To Username ]");
                                username = username + RandomStringGenerator.RandomStringAndNumber(5);
                            }

                            if (username.Count() > 15)
                            {
                                username = username.Remove(13); //Removes the extra characters
                            }
                            tempCount_usernameCheckLoop++;
                            if (tempCount_usernameCheckLoop < 5)
                            {
                                goto usernameCheckLoop;
                            }
                        }
                        else if (EmailCheck.Contains("You cannot have a blank email address"))
                        {
                            //Log("You cannot have a blank email address");
                            Created = false;
                            Globals.EnquequeDataForSignUp(new object[] { emailData, username, name, Proxy });
                        }

                        if (Created)
                        {
                            string AccountCreatePageSource = string.Empty;

                            string EscapeDataString_name = Uri.EscapeDataString(name);

                            //Replace Space (which unicode value is %20) in Pluse ....

                            EscapeDataString_name = EscapeDataString_name.Replace("%20", "+");

                            if (!string.IsNullOrEmpty(ImageURL))
                            {
                                try
                                {
                                    byte[] args = webclient.DownloadData(ImageURL);

                                    string captchaText = string.Empty;

                                    if (manualcaptch)
                                    {

                                    }
                                    else
                                    {
                                        string[] arr1 = new string[] { DBCUsername, DBCPAssword, "" };

                                        captchaText = DecodeDBC(arr1, args);
                                    }
                                    //string postdata = "authenticity_token=" + authenticitytoken + "&user%5Bname%5D=" + EscapeDataString_name + "&user%5Bemail%5D=" + Uri.EscapeDataString(Email.Replace(" ", "")) + "&user%5Buser_password%5D=" + System.Web.HttpUtility.UrlEncode(Password) + "&user%5Bscreen_name%5D=" + username + "&user%5Bremember_me_on_signup%5D=1&user%5Bremember_me_on_signup%5D=&context=front&ad_ref=&recaptcha_challenge_field=" + capcthavalue + "&recaptcha_response_field=" + System.Web.HttpUtility.UrlEncode(captchaText) + "&user%5Bdiscoverable_by_email%5D=1&user%5Bsend_email_newsletter%5D=1";
                                    string postdata = "authenticity_token=" + authenticitytoken + "&user%5Bname%5D=" + EscapeDataString_name + "&user%5Bemail%5D=" + Uri.EscapeDataString(Email.Replace(" ", "")) + "&user%5Buser_password%5D=" + System.Web.HttpUtility.UrlEncode(Password) + "&user%5Bscreen_name%5D=" + username + "&user%5Bremember_me_on_signup%5D=1&user%5Bremember_me_on_signup%5D=&context=front&ad_ref=&recaptcha_challenge_field=" + capcthavalue + "&recaptcha_response_field=" + System.Web.HttpUtility.UrlEncode(captchaText) + "&user%5Bdiscoverable_by_email%5D=1&user%5Bsend_email_newsletter%5D=1";

                                    try
                                    {
                                        AccountCreatePageSource = globusHelper.postFormData(new Uri("https://twitter.com/account/create"), postdata, "https://twitter.com/signup", "", "", "", "");
                                    }
                                    catch { };
                                    if (string.IsNullOrEmpty(AccountCreatePageSource))
                                    {
                                        Thread.Sleep(1000);
                                        AccountCreatePageSource = globusHelper.postFormData(new Uri("https://twitter.com/account/create"), postdata, "https://twitter.com/signup", "", "", "", "");
                                    }
                                }
                                catch (Exception ex)
                                {
                                    //Log(ex.Message);
                                    GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- Getting AccountCreatePageSource --> " + ex.Message, Globals.Path_AccountCreatorErrorLog);
                                    GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  SignupMultiThreaded() -- Getting AccountCreatePageSource >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs);
                                }
                            }
                            else
                            {
                                string postdata = "authenticity_token=" + authenticitytoken + "&user%5Bname%5D=" + EscapeDataString_name + "&user%5Bemail%5D=" + Email.Replace(" ", "").Replace("@", "%40") + "&user%5Buser_password%5D=" + Password + "&user%5Bscreen_name%5D=" + username + "&user%5Bremember_me_on_signup%5D=1&user%5Bremember_me_on_signup%5D=&user%5Buse_cookie_personalization%5D=1&asked_cookie_personalization_setting=1&context=front&ad_ref=&user%5Bdiscoverable_by_email%5D=1&user%5Bsend_email_newsletter%5D=1";
                                AccountCreatePageSource = globusHelper.postFormData(new Uri("https://twitter.com/account/create"), postdata, "https://twitter.com/signup", "", "", "", "");
                            }

                            //string postdata = "authenticity_token=" + authenticitytoken + "&user%5Bname%5D=" + name + "&user%5Bemail%5D=" + Email.Replace(" ", "") + "&user%5Buser_password%5D=" + Password + "&user%5Bscreen_name%5D=" + username + "&user%5Bremember_me_on_signup%5D=1&user%5Bremember_me_on_signup%5D=&context=&user%5Bdiscoverable_by_email%5D=1&user%5Bsend_email_newsletter%5D=1";
                            //string AccountCreatePageSource = globusHelper.postFormData(new Uri("https://twitter.com/account/create"), postdata, "https://twitter.com/signup", "", "", "", "");

                            if (AccountCreatePageSource.Contains("id=\"signout-form\"") && AccountCreatePageSource.Contains("/logout") && AccountCreatePageSource.Contains("id=\"signout-button")
                                || AccountCreatePageSource.Contains("/welcome/recommendations" + username))
                            {
                                Log("[ " + DateTime.Now + " ] => [ Account created With Email :" + Email + " ]");
                                lock (Lock_Createdaccounts)
                                {
                                    //GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password + ":" + username + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.path_SuccessfulCreatedAccounts);
                                    GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.path_SuccessfulCreatedAccounts);
                                }
                                NoOfSuccessfullyCreatedAccount++;
                                //After Account creation
                                if (Created)
                                {
                                    try
                                    {
                                        if (!Globals.IsUseFakeEmailAccounts)
                                        {
                                            Log("[ " + DateTime.Now + " ] => [ Going for Email Verification : " + Email + " ]");
                                            Thread.Sleep(5000);

                                            ClsEmailActivator EmailActivate = new ClsEmailActivator();
                                            bool verified = EmailActivate.EmailVerification(Email.Replace(" ", ""), Password, ref globusHelper);
                                            if (verified)
                                            {
                                                GlobusFileHelper.AppendStringToTextfileNewLine(emailData.Replace("\0", "") + ":" + username + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.path_EmailVerifiedAccounts);
                                                Log("[ " + DateTime.Now + " ] => [ Account Verified : " + Email + " ]");
                                            }
                                            else
                                            {
                                                GlobusFileHelper.AppendStringToTextfileNewLine(emailData.Replace("\0", "") + ":" + username + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.path_NonEmailVerifiedAccounts);
                                                Log("[ " + DateTime.Now + " ] => [ Account Couldn't be Email Verified : " + Email + " ]");
                                            }

                                        }

                                        try
                                        {
                                            string checkPageSource = globusHelper.getHtmlfromUrl(new Uri("https://twitter.com/"), "", "");

                                            string pstAuthToken = PostAuthenticityToken(checkPageSource, "postAuthenticityToken");

                                            #region Profilig Of new created account
                                            try
                                            {
                                                new Thread(() =>
                                                {
                                                    startProfilingAfterAccountCreation(new object[] { Email, Password, proxyAddress, proxyPort, proxyUsername, proxyPassword, pstAuthToken, globusHelper });
                                                }).Start();
                                            }
                                            catch (Exception)
                                            {
                                            }
                                            #endregion

                                            #region for Follow

                                            try
                                            {
                                                Follow(ref globusHelper, Email, pstAuthToken);
                                            }
                                            catch (Exception)
                                            {
                                            }

                                            #endregion

                                        }
                                        catch (Exception)
                                        {
                                        }

                                        clsFBAccount insertUpdateDataBase = new clsFBAccount();
                                        insertUpdateDataBase.InsertUpdateFBAccount(Email.Replace(" ", ""), Password, username, proxyAddress, proxyPort, proxyUsername, proxyPassword, "", "");
                                    }
                                    catch (Exception ex)
                                    {
                                        //Log(ex.Message);
                                        GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- Getting After Account creation --> " + ex.Message, Globals.Path_AccountCreatorErrorLog);
                                        GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  SignupMultiThreaded() -- Getting After Account creation >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs);
                                    }
                                }
                            }
                            else if (AccountCreatePageSource.Contains("/welcome/recommendations"))
                            {
                                Log("[ " + DateTime.Now + " ] => [ Account created With Email :" + Email + " ]");
                                lock (Lock_Createdaccounts)
                                {
                                    //GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password + ":" + username + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.path_SuccessfulCreatedAccounts);
                                    GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.path_SuccessfulCreatedAccounts);
                                }
                                NoOfSuccessfullyCreatedAccount++;
                                //After Account creation
                                if (Created)
                                {
                                    try
                                    {
                                        if (!Globals.IsUseFakeEmailAccounts)
                                        {
                                            Log("[ " + DateTime.Now + " ] => [ Going for Email Verification : " + Email + " ]");
                                            Thread.Sleep(5000);

                                            ClsEmailActivator EmailActivate = new ClsEmailActivator();
                                            bool verified = EmailActivate.EmailVerification(Email.Replace(" ", ""), Password, ref globusHelper);
                                            if (verified)
                                            {
                                                GlobusFileHelper.AppendStringToTextfileNewLine(emailData.Replace("\0", "") + ":" + username + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.path_EmailVerifiedAccounts);
                                                Log("[ " + DateTime.Now + " ] => [ Account Verified : " + Email + " ]");
                                            }
                                            else
                                            {
                                                GlobusFileHelper.AppendStringToTextfileNewLine(emailData.Replace("\0", "") + ":" + username + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.path_NonEmailVerifiedAccounts);
                                                Log("[ " + DateTime.Now + " ] => [ Account Couldn't be Email Verified : " + Email + " ]");
                                            }
                                        }

                                        try
                                        {
                                            string checkPageSource = globusHelper.getHtmlfromUrl(new Uri("https://twitter.com/"), "", "");

                                            string pstAuthToken = PostAuthenticityToken(checkPageSource, "postAuthenticityToken");

                                            #region Profilig Of new created account
                                            try
                                            {
                                                new Thread(() =>
                                                {
                                                    startProfilingAfterAccountCreation(new object[] { Email, Password, proxyAddress, proxyPort, proxyUsername, proxyPassword, pstAuthToken, globusHelper });
                                                }).Start();
                                            }
                                            catch (Exception)
                                            {
                                            }
                                            #endregion

                                            #region for Follow

                                            try
                                            {
                                                Follow(ref globusHelper, Email, pstAuthToken);
                                            }
                                            catch (Exception)
                                            {
                                            }

                                            #endregion

                                        }
                                        catch (Exception)
                                        {
                                        }

                                        clsFBAccount insertUpdateDataBase = new clsFBAccount();
                                        insertUpdateDataBase.InsertUpdateFBAccount(Email.Replace(" ", ""), Password, username, proxyAddress, proxyPort, proxyUsername, proxyPassword, "", "");
                                    }
                                    catch (Exception ex)
                                    {
                                        //Log(ex.Message);
                                        GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- Getting After Account creation --> " + ex.Message, Globals.Path_AccountCreatorErrorLog);
                                        GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  SignupMultiThreaded() -- Getting After Account creation >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs);
                                    }
                                }
                            }
                            else if (AccountCreatePageSource.ToLower().Contains("password is too obvious") || AccountCreatePageSource.ToLower().Contains("\"active error\">password"))
                            {
                                NoOfNonCreatedAccounts++;
                                tempCount_passwordCheckLoop = 0;
                                if (Password.Count() > 8)
                                {
                                    Password = Password.Remove(8); //Removes the extra characters
                                }
                                Password = Password + RandomStringGenerator.RandomString(3);
                                if (Password.Count() > 12)
                                {
                                    Password = Password.Remove(12); //Removes the extra characters
                                }
                                tempCount_passwordCheckLoop++;
                                if (tempCount_passwordCheckLoop < 5)
                                {
                                    goto usernameCheckLoop;
                                }
                                //Password = Password + RandomStringGenerator.RandomString(3);
                                Log("[ " + DateTime.Now + " ] => [ Please Create Accounts With Secure Password ]");
                                Log("[ " + DateTime.Now + " ] => [ Password is too obvious ]");
                                Log("[ " + DateTime.Now + " ] => [ Email : Password --> " + Email + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword + " ]");
                                goto usernameCheckLoop;
                                //return;
                            }
                            else if (AccountCreatePageSource.Contains("/sessions/destroy") && AccountCreatePageSource.Contains("/signup"))
                            {
                                lock (Lock_notCreatedaccounts)
                                {
                                    GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.path_FailedCreatedAccounts);
                                    GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password, Globals.path_FailedCreatedAccountsOnlyEmailPass);
                                }
                                NoOfNonCreatedAccounts++;
                                NoOfNonCreatedAccountsProxy++;
                                Log("[ " + DateTime.Now + " ] => [ You can't do that right now. ]");
                                Log("[ " + DateTime.Now + " ] => [ Sorry, please try again later ]");
                                Log("[ " + DateTime.Now + " ] => [ and Change proxy to create more accounts. ]");

                                Globals.EnquequeDataForSignUp(new object[] { emailData, username, name, Proxy });

                                return;
                            }
                            else
                            {
                                Globals.EnquequeDataForSignUp(new object[] { emailData, username, name, Proxy });
                                lock (Lock_notCreatedaccounts)
                                {
                                    GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.path_FailedCreatedAccounts);
                                    GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password, Globals.path_FailedCreatedAccountsOnlyEmailPass);
                                }
                                NoOfNonCreatedAccounts++;
                                Log("[ " + DateTime.Now + " ] => [ Couldn't create Account ]");
                                Log("[ " + DateTime.Now + " ] => [ Email : Password --> " + Email + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword + " ]");
                            }
                            //if (Created)
                            //{
                            //    Log("Going for Email Verification : " + Email);
                            //    Thread.Sleep(5000);

                            //    ClsEmailActivator EmailActivate = new ClsEmailActivator();
                            //    bool verified = EmailActivate.EmailVerification(Email.Replace(" ", ""), Password, ref globusHelper);
                            //    if (verified)
                            //    {
                            //        GlobusFileHelper.AppendStringToTextfileNewLine(emailData, Globals.path_SuccessfulCreatedAccounts);
                            //        Log("Account Verified : " + Email);
                            //    }
                            //    else
                            //    {
                            //        GlobusFileHelper.AppendStringToTextfileNewLine(emailData, Globals.path_NonEmailVerifiedAccounts);
                            //        Log("Account Couldn't be Email Verified : " + Email);
                            //    }
                            //}
                        }
                        else
                        {
                            NoOfNonCreatedAccounts++;

                            if (EmailCheck.Contains("Email has already been taken. An email can only be used on one Twitter account at a time"))
                            {
                                NoOfAlreadyCreatedAccounts++;
                                Log("[ " + DateTime.Now + " ] => [ " + Email + " : Email has already been taken. ]");
                                Log("[ " + DateTime.Now + " ] => [ An email can only be used on one Twitter account at a time ]");
                                GlobusFileHelper.AppendStringToTextfileNewLine(emailData.Replace("\0", ""), Globals.path_EmailAlreadyTaken);
                            }
                            else if (Usernamecheck.Contains("Username has already been taken"))
                            {
                                Log("[ " + DateTime.Now + " ] => [ " + username + " : Username has already been taken ]");
                                Globals.EnquequeDataForSignUp(new object[] { emailData, username, name, Proxy });
                            }
                            else if (EmailCheck.Contains("You cannot have a blank email address"))
                            {
                                Log("[ " + DateTime.Now + " ] => [ " + Email + " : You cannot have a blank email address ]");
                                Globals.EnquequeDataForSignUp(new object[] { emailData, username, name, Proxy });
                            }
                            else
                            {
                                ExportFailedAccounts(Email, Password, proxyAddress, proxyPort, proxyUsername, proxyPassword);
                                Globals.EnquequeDataForSignUp(new object[] { emailData, username, name, Proxy });
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        NoOfNonCreatedAccounts++;
                        lock (Lock_notCreatedaccounts)
                        {
                            GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.path_FailedCreatedAccounts);
                            GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password, Globals.path_FailedCreatedAccountsOnlyEmailPass);
                        }
                        GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- Posting data --> " + ex.Message, Globals.Path_AccountCreatorErrorLog);
                        GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  SignupMultiThreaded() -- Posting data >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs);

                        Globals.EnquequeDataForSignUp(new object[] { emailData, username, name, Proxy });
                    }
                }
                catch (Exception ex)
                {
                    NoOfNonCreatedAccounts++;
                    lock (Lock_notCreatedaccounts)
                    {
                        GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.path_FailedCreatedAccounts);
                        GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password, Globals.path_FailedCreatedAccountsOnlyEmailPass);
                    }
                    //GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.path_FailedCreatedAccounts);
                    //Console.WriteLine("4 : " + ex.Message);
                    GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- SignupMultiThreaded Start --> " + ex.Message, Globals.Path_AccountCreatorErrorLog);
                    GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  SignupMultiThreaded() -- SignupMultiThreaded Start >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs);

                    Globals.EnquequeDataForSignUp(new object[] { emailData, username, name, Proxy });
                }
                finally
                {
                    CountOfAccounts++;
                    if (CountOfAccounts >= TotalEmailUploaded)
                    {
                        Log("[ " + DateTime.Now + " ] => [ Account Creation Finished ]");
                        Log("[ " + DateTime.Now + " ] => [ No Of SuccessFully Created Accounts : " + NoOfSuccessfullyCreatedAccount + " ]");
                        Log("[ " + DateTime.Now + " ] => [ No Of Non Created Accounts : " + NoOfNonCreatedAccounts + " ]");
                    }

                    //Log("SuccessFully Created Accounts Count: " + NoOfSuccessfullyCreatedAccount);
                    //Log("Failed Accounts Count: " + NoOfNonCreatedAccounts);
                    //Log("Already Created Accounts Count: " + NoOfAlreadyCreatedAccounts);
                    //Log("Failed Proxies Count: " + NoOfNonCreatedAccountsProxy);
                }

            }
            catch
            {
            }
        }
コード例 #18
0
ファイル: PageManager.cs プロジェクト: shah8701/faceboard
        /// <summary>
        /// Gets all Comment IDs from FanPage
        /// </summary>
        /// <param name="pageUrl"></param>
        private void AjaxPoster(object pageUrl)
        {
            try
            {
                lstFanPageScraperThreads.Add(Thread.CurrentThread);
                lstFanPageScraperThreads.Distinct();
                Thread.CurrentThread.IsBackground = true;
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
            try
            {
                if (!isStopFanPageScraper)
                {

                    List<string> Idlist = new List<string>();

                    string[] arrayPageUrl = (string[])pageUrl;
                    string PageUrl = arrayPageUrl[0];

                    // QueryManager QM = new QueryManager();


                    GlobusLogHelper.log.Info("Fans Crawler Started With Page URL :" + PageUrl);
                    GlobusLogHelper.log.Debug("Fans Crawler Started With Page URL :" + PageUrl);

                    GlobusHttpHelper httpHelper = new GlobusHttpHelper();

                    List<string> PageletList = new List<string>();
                    List<string> StartList = new List<string>();
                    List<string> EndList = new List<string>();
                    int counter = 1;
                    string PageUrls = PageUrl;
                    string ajaxpipe_token = string.Empty;
                    string profile_id = string.Empty;
                    string start2 = string.Empty;
                    string start3 = string.Empty;
                    string start4 = string.Empty;
                    string start5 = string.Empty;

                    string End2 = string.Empty;
                    string End3 = string.Empty;
                    string End4 = string.Empty;
                    string End5 = string.Empty;

                    string query_type = string.Empty;
                    string time_cutoff = string.Empty;
                    string filter_after_timestamp = string.Empty;

                    string jsonRes = httpHelper.getHtmlfromUrlProxy(new Uri(PageUrls), "", 80, "", "");

                 //string[] ajexdataForTimeplane = System.Text.RegularExpressions.Regex.Split(jsonRes, "section_pagelet_id");
                    string[] ajexdataForTimeplane = System.Text.RegularExpressions.Regex.Split(jsonRes, "profile_id");
                    
                    foreach (string item in ajexdataForTimeplane)
                    {
                        try
                        {
                            if (!item.Contains("<!DOCTYPE"))
                            {
                                string data = item.Substring(item.IndexOf(":"), item.IndexOf(",") - item.IndexOf(":")).Replace(":", "").Replace("\"", "").Replace("\\", "").Replace("&quot;", "").Trim();
                                {
                                    try
                                    {
                                        string plane = data;
                                        PageletList.Add(plane);
                                       // PageletList=PageletList.Distinct().ToList();
                                    }
                                    catch (Exception ex)
                                    {
                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                    }
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }

                    string[] ajexdata = System.Text.RegularExpressions.Regex.Split(jsonRes, "ajaxpipe_token");
                    foreach (string item in ajexdata)
                    {
                        try
                        {
                            if (!item.Contains("<!DOCTYPE"))
                            {
                                string data = item.Substring(item.IndexOf(":"), item.IndexOf(",") - item.IndexOf(":")).Replace(":", "").Replace("\"", "");
                                {
                                    ajaxpipe_token = data;
                                    break;
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }
                    string[] ajexdata1 = System.Text.RegularExpressions.Regex.Split(jsonRes, "profile_id");
                    foreach (string item in ajexdata1)
                    {
                        try
                        {
                            if (!item.Contains("<!DOCTYPE"))
                            {
                                string data = item.Substring(item.IndexOf(":"), item.IndexOf(",") - item.IndexOf(":")).Replace(":", "").Replace("\"", "").Replace("&quot;", "");
                                {
                                    profile_id = data;
                                    break;
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }
                    int Startcounter = 1;
                    string[] ajexdata2 = System.Text.RegularExpressions.Regex.Split(jsonRes, "start");

                    foreach (string item in ajexdata2)
                    {
                        if (!item.Contains("<!DOCTYPE") && item.Count() < 1000)
                        {
                            try
                            {

                                if (Startcounter < PageletList.Count())
                                {
                                    if (item.Contains(PageletList[Startcounter].ToString()))
                                    {
                                        string data = item.Substring(item.IndexOf(":"), item.IndexOf(",") - item.IndexOf(":")).Replace(":", "").Replace("\"", "").Replace("&quot;", ""); 
                                        {
                                            try
                                            {

                                                StartList.Add(data);
                                                Startcounter++;
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }
                                    }
                                }
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }
                        }
                    }
                    if (StartList.Count()==0)
                    {

                        foreach (string item in ajexdata2)
                        {
                            if (!item.Contains("<!DOCTYPE"))
                            {
                                try
                                {
                                    //  if (Startcounter < PageletList.Count())
                                    {
                                        if (item.Contains(PageletList[Startcounter].ToString()))
                                        {
                                            if (!item.Contains("contextwindowend"))
                                            {
                                                string data = item.Substring(item.IndexOf(":"), item.IndexOf(",") - item.IndexOf(":")).Replace(":", "").Replace("\"", "").Replace("&quot;", "");
                                                {
                                                    try
                                                    {

                                                        StartList.Add(data);
                                                        Startcounter++;
                                                    }
                                                    catch (Exception ex)
                                                    {
                                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }
                        }
                      
                        
                    }


                    if (StartList.Count() == 0)
                    {

                        foreach (string item in ajexdata2)
                        {
                            if (!item.Contains("<!DOCTYPE"))
                            {
                                try
                                {
                                    //  if (Startcounter < PageletList.Count())
                                    {
                                       // if (item.Contains(PageletList[Startcounter].ToString()))
                                        {
                                            if (!item.Contains("contextwindowend"))
                                            {
                                                string data = item.Substring(item.IndexOf(":"), item.IndexOf(",") - item.IndexOf(":")).Replace(":", "").Replace("\"", "").Replace("&quot;", "");
                                                {
                                                    try
                                                    {
                                                        if (Utils.IsNumeric(data))
                                                        {
                                                            StartList.Add(data);
                                                            Startcounter++;
                                                        } 
                                                      
                                                    }
                                                    catch (Exception ex)
                                                    {
                                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }
                        }
                    }

                    int Endcounter = 1;
                    string[] ajexdata3 = System.Text.RegularExpressions.Regex.Split(jsonRes, "end");
                    foreach (string item in ajexdata3)
                    {

                        if (!item.Contains("<!DOCTYPE") && item.Count() < 1000)
                        {
                            try
                            {

                               if (Endcounter < PageletList.Count())
                                {
                                    if ((item.Contains(PageletList[Endcounter].ToString()) && item.Contains("query_type"))&&!item.Contains("contextwindowend"))
                                    {
		 

                                        string data = item.Substring(item.IndexOf(":"), item.IndexOf(",") - item.IndexOf(":")).Replace(":", "").Replace("\"", "").Replace("&quot;", "") ;
                                        {
                                            try
                                            {
                                                string EndData = data;
                                                EndList.Add(EndData);
                                                Endcounter++;
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }
                                        
                                    }
                                }

                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }
                        }

                    }


                    if (EndList.Count() == 0)
                    {
                        foreach (string item in ajexdata3)
                        {

                            if (!item.Contains("<!DOCTYPE"))
                            {
                                try
                                {

                                    if (Endcounter < PageletList.Count())
                                    {
                                        if (item.Contains(PageletList[Endcounter].ToString()) && !item.Contains("pages_actions_pagelet") && (item.Contains(",\\\"query_type\\\"") || item.Contains(",\"query_type\"")))
                                        {
                                            string data = item.Substring(item.IndexOf(":"), item.IndexOf(",") - item.IndexOf(":")).Replace(":", "").Replace("\"", "").Replace("&quot;", "");
                                            {
                                                try
                                                {
                                                    string EndData = data;
                                                    EndList.Add(EndData);
                                                    Endcounter++;
                                                }
                                                catch (Exception ex)
                                                {
                                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                }
                                            }
                                        }
                                    }

                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }

                        }
                    }

                    if (EndList.Count() == 0)
                    {
                        foreach (string item in ajexdata3)
                        {

                            if (!item.Contains("<!DOCTYPE"))
                            {
                                try
                                {

                                  //  if (Endcounter < PageletList.Count())
                                    {
                                       // if (item.Contains(PageletList[Endcounter].ToString()) && !item.Contains("pages_actions_pagelet") && (item.Contains(",\\\"query_type\\\"") || item.Contains(",\"query_type\"")))
                                        {
                                            string data = item.Substring(item.IndexOf(":"), item.IndexOf(",") - item.IndexOf(":")).Replace(":", "").Replace("\"", "").Replace("&quot;", "");
                                            {
                                                try
                                                {
                                                    if (Utils.IsNumeric(data))
                                                    {
                                                        string EndData = data;
                                                        EndList.Add(EndData);
                                                        Endcounter++;
                                                    }
                                                }
                                                catch (Exception ex)
                                                {
                                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                }
                                            }
                                        }
                                    }

                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }

                        }
                    }




                    string[] ajexdata4 = System.Text.RegularExpressions.Regex.Split(jsonRes, "query_type");
                    foreach (string item in ajexdata4)
                    {
                        try
                        {
                            if (!item.Contains("<!DOCTYPE"))
                            {
                                string data = item.Substring(item.IndexOf(":"), item.IndexOf(",") - item.IndexOf(":")).Replace(":", "").Replace("\"", "").Replace("&quot;", "");
                                {
                                    query_type = data;
                                    break;
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }

                    string[] ajexdata5 = System.Text.RegularExpressions.Regex.Split(jsonRes, "filter_after_timestamp");
                    foreach (string item in ajexdata5)
                    {
                        try
                        {
                            if (!item.Contains("<!DOCTYPE"))
                            {

                                string data = item.Substring(item.IndexOf(":"), item.IndexOf(",") - item.IndexOf(":")).Replace(":", "").Replace("\"", "").Replace("&quot;", "") ;
                                {
                                    filter_after_timestamp = data;
                                    break;
                                }

                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }


                    string _a = string.Empty;
                    string pagelet_timeline = string.Empty;
                    string start = string.Empty;
                    string End = string.Empty;
                    PageletList.RemoveAt(0);
                    Dictionary<string, string> CheckDuplicate = new Dictionary<string, string>();
                    int Acounter = 0;

                    foreach (string Pagename in PageletList)
                    {
                        try
                        {
                            pagelet_timeline = Pagename;
                            if (Acounter == 0)
                            {
                                _a = "_a";
                            }
                            else
                            {
                                _a = "__a";
                            }
                            try
                            {
                                start = StartList[Acounter];
                                End = EndList[Acounter];
                            }
                            catch { };


                            time_cutoff = Utils.GenerateTimeStamp();
                            string AjexPoster = FBGlobals.Instance.PageManagerAjaxPosterUrl + _a + "=1&ajaxpipe=1&ajaxpipe_token=" + ajaxpipe_token + "&data=%7B%22profile_id%22%3A" + profile_id + "%2C%22start%22%3A" + start + "%2C%22end%22%3A" + End + "%2C%22query_type%22%3A6%2C%22section_pagelet_id%22%3A%22" + pagelet_timeline + "%22%2C%22load_immediately%22%3A" + "false" + "%2C%22time_cutoff%22%3A" + time_cutoff + "%2C%22force_no_friend_activity%22%3Afalse%7D&__user=0&__adt=" + counter;

                            string jsonRes12 = httpHelper.getHtmlfromUrlProxy(new Uri(AjexPoster), "", 80, "", "");
                            if (string.IsNullOrEmpty(jsonRes12))
                            {
                                AjexPoster = "https://www.facebook.com/ajax/pagelet/generic.php/ProfileTimelineSectionPagelet?ajaxpipe=1&ajaxpipe_token=" + ajaxpipe_token + "&no_script_path=1&data=%7B%22profile_id%22%3A" + profile_id + "%2C%22start%22%3A" + start + "%2C%22end%22%3A" + End + "%2C%22query_type%22%3A8%2C%22filter_after_timestamp%22%3A" + pagelet_timeline + "%2C%22section_pagelet_id%22%3A%22pagelet_timeline_year_current%22%2C%22load_immediately%22%3Afalse%2C%22force_no_friend_activity%22%3Afalse%7D&__user=0&__a=1&__dyn=7xK4Gz610Ax-7o8UhACx6GxrLFDwgoiw&__req=jsonp_2&__rev=1279725&__adt=" + +counter;
                                jsonRes12 = httpHelper.getHtmlfromUrlProxy(new Uri(AjexPoster), "", 80, "", "");
                            }
                            counter++;

                            string[] textdata = System.Text.RegularExpressions.Regex.Split(jsonRes12, "likes");
                            foreach (string itemText in textdata)
                            {
                                try
                                {
                                    if (itemText.Contains("?id=")) //if (itemText.Contains("/?id="))
                                    {
                                        string data = itemText.Substring(itemText.IndexOf("id="), itemText.IndexOf("\"") - itemText.IndexOf("id=") - 1).Replace("id=", "").Replace("\"", "").Replace("&quot;", "").Trim();
                                        Idlist.Add(data);
                                        try
                                        {
                                            CheckDuplicate.Add(data, data);
                                            GlobusLogHelper.log.Info("Scraping  UserId : " + data);
                                            //GlobusLogHelper.log.Debug("Scrape  UserId : " + data  );
                                        }
                                        catch (Exception ex)
                                        {
                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }
                            Idlist = Idlist.Distinct().ToList();
                            Acounter++;
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }


                    foreach (string IDitem in Idlist)                    
                    {
                        if (!isStopFanPageScraper)
                        {
                           
                            try
                            {
                                GlobusLogHelper.log.Info("Scraping Like UserId : " + IDitem + " On Fans : " + PageUrls);
                                GlobusLogHelper.log.Debug("Scraping Like UserId : " + IDitem + " On Fans : " + PageUrls);

                                #region UseLessCOde
                                //try
                                //{
                                //    string CSVHeader = "PageUrl" + "," + "UserId";
                                //    string CSV_Content = PageUrls + "," + IDitem;

                                //    Globussoft.GlobusFileHelper.ExportDataCSVFile(CSVHeader, CSV_Content, ScrapersExprotFilePath);
                                //}
                                //catch (Exception ex)
                                //{
                                //    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                //}

                                //Globussoft.GlobusFileHelper.ExportDataCSVFile();

                                //Add Comment ID to tb_FbFirstID with Status=0 & Level=0 
                                #endregion

                                string queryResponse = string.Empty;

                                DataSet ds = new DataSet();

                                RaiseEvent(ds, new string[] { "Model : FanPagePostRepository", "Function : Insert", IDitem, "0", "0", System.DateTime.Now.ToString(), PageUrls, queryResponse });

                                if (queryResponse.Contains("locked"))
                                {
                                    try
                                    {

                                        lock (lockrqueueAddFirstID)
                                        {
                                            queueAddFirstID.Enqueue(IDitem + "<:>" + PageUrls);
                                        }
                                    }
                                    catch(Exception  ex)
                                    {
                                        GlobusLogHelper.log.Error("Error : "+ex.StackTrace);
                                    }
                                }
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }
                        }

                    }

                    if (!isStopFanPageScraper)
                    {
                        new Thread(() =>
                        {
                            try
                            {
                              
                                try
                                {
                                    lstFanPageScraperThreads.Add(Thread.CurrentThread);
                                    lstFanPageScraperThreads.Distinct();
                                    Thread.CurrentThread.IsBackground = true;
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                                dictionaryLikerThreads.Add("thread_ParseAjaxID_" + PageUrl.Replace("/", "").Replace(":", ""), Thread.CurrentThread);
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }
                            while (true)
                            {
                                Thread.Sleep(1000 * 80);
                               // Thread.Sleep(1000 * 8);
                                ParseAjaxID(PageUrl);
                            }
                        }).Start();


                    }
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
            finally
            {
                //if (!IsCloseCalled)
                {
                    countThreadControllerMain--;
                    lock (lockrThreadControllerMain)
                    {
                        //if (!IsCloseCalled)
                        {
                            Monitor.Pulse(lockrThreadControllerMain);
                        }
                    }
                }
            }
        }
コード例 #19
0
        public bool LoginHttpHelper(string username, string password, string proxyaddress, string proxyport, string proxyusername, string proxypassword, ref GlobusHttpHelper HttpHelper, ref string Message)
        {
            bool isLoggin = false;

            try
            {
                // LoggerLoginLogout("Logging Block.............");
                string Url       = string.Empty;
                int    port      = 888;
                Regex  PortCheck = new Regex("^[0-9]*$");

                _AccountUser   = username;
                _AccountPass   = password;
                _ProxyAddress  = proxyaddress;
                _ProxyPort     = proxyport;
                _ProxyUserName = proxyusername;
                _ProxyPassword = proxypassword;

                if (PortCheck.IsMatch(_ProxyPort) && !string.IsNullOrEmpty(_ProxyPort))
                {
                    port = int.Parse(_ProxyPort);
                }

                if (string.IsNullOrEmpty(_ProxyPort))
                {
                    _ProxyPort = "0";
                }

                Url = "https://www.linkedin.com/";
                // string pageSrcLogin = HttpChilkat.GetHtmlProxy(Url, proxyAddress, proxyPort, proxyUserName, proxyPassword);
                string pageSrcLogin = string.Empty;

                try
                {
                    pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), _ProxyAddress, (port), _ProxyUserName, _ProxyPassword);//HttpHelper.getHtmlfromUrl(new Uri(Url));
                }
                catch { }


                string postdata     = string.Empty;
                string postUrl      = string.Empty;
                string ResLogin     = string.Empty;
                string csrfToken    = string.Empty;
                string sourceAlias  = string.Empty;
                string regCsrfParam = string.Empty;

                #region commented
                //if (pageSrcLogin.Contains("csrfToken"))
                //{
                //    try
                //    {
                //        csrfToken = pageSrcLogin.Substring(pageSrcLogin.IndexOf("csrfToken"), 100);
                //        string[] Arr = csrfToken.Split('"');
                //        csrfToken = Arr[2].Replace("\\",string.Empty).Replace("\"",string.Empty).Trim();
                //    }
                //    catch
                //    {
                //        try
                //        {
                //            csrfToken = pageSrcLogin.Substring(pageSrcLogin.IndexOf("csrfToken"), 100);
                //            string[] Arr = csrfToken.Split('&');
                //            csrfToken = Arr[0].Replace("\\", string.Empty).Replace("\"", string.Empty).Replace("csrfToken=", "").Replace(">",string.Empty).Trim();
                //        }
                //        catch
                //        {
                //            try
                //            {
                //                csrfToken = pageSrcLogin.Substring(pageSrcLogin.IndexOf("csrfToken"), 100);
                //                string[] Arr = csrfToken.Split(',');
                //                csrfToken = Arr[0].Replace("\\", string.Empty).Replace("\"", string.Empty).Replace("csrfToken=", "").Replace(">", string.Empty).Trim();
                //            }
                //            catch { }
                //        }

                //    }
                //}

                //if (csrfToken.Contains(">") && csrfToken.Contains("csrfToken="))
                //{
                //    try
                //    {
                //        csrfToken = csrfToken.Substring(csrfToken.IndexOf("ajax"), csrfToken.IndexOf(">") - csrfToken.IndexOf("ajax")).Replace("csrfToken=", "").Trim();

                //    }
                //    catch { }

                //}

                //if (pageSrcLogin.Contains("sourceAlias"))
                //{
                //    try
                //    {

                //        sourceAlias = pageSrcLogin.Substring(pageSrcLogin.IndexOf("sourceAlias"), 100);
                //        string[] Arr = sourceAlias.Split('"');
                //        sourceAlias = Arr[2].Replace("\\", string.Empty).Replace("\"", string.Empty).Trim();
                //    }
                //    catch { }
                //}
                ////_AccountUser = "******";
                ////_AccountPass = "******";


                ////_AccountUser = "******";

                // _AccountUser = Uri.EscapeDataString(_AccountUser);
                //postUrl = "https://www.linkedin.com/uas/login-submit";
                ////postdata = "session_key=" + _AccountUser + "&session_password="******"&source_app=&trk=guest_home_login&session_redirect=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;
                //postdata = "session_key=" + _AccountUser + "&session_password="******"&source_app=&trk=guest_home_login&session_redirect=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;

                #endregion

                if (pageSrcLogin.Contains("csrfToken"))
                {
                    try
                    {
                        int    startIndex = pageSrcLogin.IndexOf("name=\"csrfToken\"");
                        string start      = pageSrcLogin.Substring(startIndex).Replace("name=\"csrfToken\"", "");
                        int    endIndex   = start.IndexOf("\" ");
                        string end        = start.Substring(0, endIndex).Replace("value=\"", "").Trim();
                        csrfToken = end;
                    }
                    catch (Exception ex)
                    {
                    }
                }

                try
                {
                    if (csrfToken.Contains("&"))
                    {
                        string[] Arr = csrfToken.Split('&');
                        csrfToken = Arr[0].Replace("\"", string.Empty);
                    }
                }
                catch { }

                if (pageSrcLogin.Contains("sourceAlias"))
                {
                    sourceAlias = pageSrcLogin.Substring(pageSrcLogin.IndexOf("sourceAlias"), 100);
                    string[] Arr = sourceAlias.Split('"');
                    sourceAlias = Arr[2].Replace(@"\", string.Empty).Replace("//", string.Empty).Trim();
                }


                try
                {
                    int SourceAliasStart = pageSrcLogin.IndexOf("regCsrfParam");
                    if (SourceAliasStart > 0)
                    {
                        try
                        {
                            regCsrfParam = pageSrcLogin.Substring(pageSrcLogin.IndexOf("regCsrfParam"), 100);
                            string[] Arr = regCsrfParam.Split('"');
                            regCsrfParam = Arr[2].Replace(@"\", string.Empty).Replace("//", string.Empty);
                        }
                        catch
                        {
                        }
                    }
                }
                catch { }

                postUrl  = "https://www.linkedin.com/uas/login-submit";
                postdata = "isJsEnabled=true&source_app=&tryCount=&session_key=" + Uri.EscapeDataString(_AccountUser) + "&session_password="******"&signin=Sign%20In&session_redirect=&loginCsrfParam=" + regCsrfParam + "&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;

                try
                {
                    ResLogin = HttpHelper.postFormDataProxy(new Uri(postUrl), postdata, _ProxyAddress, int.Parse(_ProxyPort), _ProxyUserName, _ProxyPassword);//HttpHelper.postFormDataRef(new Uri(postUrl), postdata, "http://www.linkedin.com/uas/login?goback=&trk=hb_signin", "", "");
                }
                catch { }


                if (ResLogin.Contains("The email address or password you provided does not match our records"))
                {
                    GlobusFileHelper.WriteStringToTextfile(_AccountUser + ":" + _AccountPass + ":" + _ProxyAddress + ":" + _ProxyPort + ":" + _ProxyUserName + ":" + _ProxyPassword, Globals.path_FailLogin);
                    Message = "The email address or password does not match our records";
                    return(false);
                }
                else if (ResLogin.Contains("Sign Out") && ResLogin.Contains("Profiles"))
                {
                    Message = "Logged in";
                    return(true);
                }
                else if (ResLogin.Contains("Your LinkedIn account has been temporarily restricted"))
                {
                    Message = "Your LinkedIn account has been temporarily restricted";
                    return(false);
                }
                else if (ResLogin.Contains("Sign Out"))
                {
                    Message = "Logged in";
                    return(true);
                }
                else if (ResLogin.Contains("This login attempt seems suspicious") || ResLogin.Contains("Please enter the verification code sent to the email"))
                {
                    GlobusFileHelper.WriteStringToTextfile(_AccountUser + ":" + _AccountPass + ":" + _ProxyAddress + ":" + _ProxyPort + ":" + _ProxyUserName + ":" + _ProxyPassword, Globals.path_FailLogin);
                    Message = "This login attempt seems suspicious.Please enter the verification code sent to the email.";
                    return(false);
                }
                else
                {
                    Message = "Couldn't Login";
                    GlobusFileHelper.WriteStringToTextfile(_AccountUser + ":" + _AccountPass + ":" + _ProxyAddress + ":" + _ProxyPort + ":" + _ProxyUserName + ":" + _ProxyPassword, Globals.path_FailLogin);
                    return(false);
                }
                //Url = "http://www.linkedin.com/home?trk=hb_tab_home_top";
                //pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), _ProxyPassword, port, _ProxyUserName, _ProxyPassword);

                //LogoutHttpHelper(ref HttpHelper);

                //Url = "http://www.linkedin.com/home?trk=hb_tab_home_top";
                //pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), _ProxyPassword, 888, _ProxyUserName, _ProxyPassword);
                //return true;
            }
            catch
            {
            }
            return(isLoggin);
        }
コード例 #20
0
ファイル: PageManager.cs プロジェクト: shah8701/faceboard
        /// <summary>
        /// Gets Next Page URLs as well as End User IDs from Comment
        /// </summary>
        /// <param name="jsonRes"></param>
        /// <param name="PageURL"></param>
        private void ParseJson_Comments_Next_Phase1(string jsonRes, string PageURL)
        {
            try
            {
                lstFanPageScraperThreads.Add(Thread.CurrentThread);
                lstFanPageScraperThreads.Distinct();
                Thread.CurrentThread.IsBackground = true;
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }

            try
            {
                string jsonData = jsonRes;
                JObject likes = null;
                JObject Data = null;
                try
                {
                    Data = JObject.Parse(jsonData);

                    likes = (JObject)Data["likes"];
                }
                catch { };
                //Paging
                JObject paging = null;//(JObject)likes["paging"];

                if (likes != null) //Get Next Page Node under Likes Node
                {
                    paging = (JObject)likes["paging"];
                }
                else //If no Likes Node, Get Next Page Node under Data Node
                {
                    paging = (JObject)Data["paging"];
                }

                //Next URL
                string next = (string)((JValue)paging["next"]);

                int startIndx = next.IndexOf("limit=") + "limit=".Length;
                int endIndx = next.IndexOf("&", startIndx);

                string limitValueToReplace = "limit=" + next.Substring(startIndx, endIndx - startIndx);

                next = next.Replace(limitValueToReplace, "limit=1000");

                GlobusHttpHelper httpHelper = new GlobusHttpHelper();
                string nextRes = httpHelper.getHtmlfromUrlProxy(new Uri(next), "", 80, "", "");


                #region Get Next Page Data and IDs and Insert in tb_FbFirstID with Status=0 & Level=1, means End User ID
                JObject nextData = JObject.Parse(nextRes);

                JArray array_data = (JArray)nextData["data"];

                foreach (var item in array_data)
                {
                    try
                    {
                        JObject objData_Node = JObject.Parse(item.ToString());

                        JValue jVaule_id = (JValue)objData_Node["id"];

                        string str_id = jVaule_id.ToString().Replace("\"", "");

                        try
                        {
                            string queryResponse = string.Empty;

                            //qm.AddFirstID(str_id, "0", "1", System.DateTime.Now.ToString(), PageURL, ref queryResponse);

                            DataSet ds = new DataSet();
                            RaiseEvent(ds, new string[] { "Model : FanPagePostRepository", "Function : InsertChasngeLevel", str_id, "0", "1", System.DateTime.Now.ToString(), PageURL, queryResponse });


                            if (queryResponse.Contains("locked"))
                            {
                                Thread.Sleep(1000);

                                // QueryManager myQueryManager = new QueryManager();

                                //myQueryManager.AddFirstID(str_id, "0", "1", System.DateTime.Now.ToString(), PageURL, ref queryResponse);

                                RaiseEvent(ds, new string[] { "Model : FanPagePostRepository", "Function : InsertChasngeLevel", str_id, "0", "1", System.DateTime.Now.ToString(), PageURL, queryResponse });

                            }

                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }

                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }

                }
                #endregion

                #region Unused
                if (nextRes.Contains("\"data\":"))
                {
                    try
                    {
                        string status = "1";

                        //QueryManager query = new QueryManager();

                        try
                        {
                            // query.AddFirstID_Graph(next, "0", "0", DateTime.Now.ToString(), PageURL);

                            DataSet ds = new DataSet();
                            RaiseEvent(ds, new string[] { "Model : FanPagePostRepository", "Function : Insert", next, "0", "0", System.DateTime.Now.ToString(), PageURL });


                            GlobusLogHelper.log.Info("FbId Next Page Url  :  " + next);
                            GlobusLogHelper.log.Debug("FbId Next Page Url  :  " + next);
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }

                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                }
                else
                {
                    string status = "0";

                    try
                    {
                        //DataBaseHandler.InsertQuery("Insert into Tb_NextPage(id,NextPageUrl,Status,Date,MainPageUrl) values('" + 0 + "','" + next + "','" + "0" + "','" + System.DateTime.Now.ToString() + "','" + PageURL + "','" + PageURL + "')", "Tb_NextPage");

                        //QueryManager query = new QueryManager();

                        //query.AddFirstID_Graph(next, status, "0", DateTime.Now.ToString(), PageURL); //DataBaseHandler.InsertQuery("Insert into Tb_NextPage(id,NextPageUrl,Status,Date,MainPageUrl) values('" + 0 + "','" + next + "','" + "0" + "','" + System.DateTime.Now.ToString() + "','" + PageURL + "','" + PageURL + "')", "Tb_NextPage");

                        DataSet ds = new DataSet();
                        RaiseEvent(ds, new string[] { "Model : FanPagePostRepository", "Function : Insert", next, status, "0", System.DateTime.Now.ToString(), PageURL });

                        GlobusLogHelper.log.Info("FbId Next Page Url  :  " + next);
                        GlobusLogHelper.log.Debug("FbId Next Page Url  :  " + next);

                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }

                }
                #endregion

            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }
コード例 #21
0
        public bool Login()
        {
            string OAuthVerifier      = string.Empty;
            string OAuthenticityToken = string.Empty;
            string OAuthToken         = string.Empty;
            string PinToken           = string.Empty;
            string InviteUrl          = string.Empty;

            bool IsAccountCreated = false;

            try
            {
                string ts = GenerateTimeStamp();

                InviteUrl = "http://pinterest.com/invited/?email=" + PinEmail + "&invite=" + InviteCode;
                InviteUrl = "http://pinterest.com/invited/?invite=" + InviteCode;

                int intProxyPort = 80;
                if (ApplicationData.ValidateNumber(this.proxyPort))
                {
                    intProxyPort = int.Parse(this.proxyPort);
                }

                string TwitterPageContent = httpHelper.getHtmlfromUrlProxy(new Uri("https://twitter.com/"), "", this.proxyAddress, intProxyPort, this.proxyUsername, this.proxyPassword, this.userAgent);
                string BootPageContent    = httpHelper.getHtmlfromUrl(new Uri("https://twitter.com/account/bootstrap_data?r=0.9414130715097342"), "https://twitter.com/", "", this.userAgent);

                //string PostData = "session%5Busername_or_email%5D=" + TwitterUsername + "&session%5Bpassword%5D=" + TwitterPassword  + "&scribe_log=%5B%22%7B%5C%22event_name%5C%22%3A%5C%22web%3Afront%3Alogin_callout%3Aform%3A%3Alogin_click%5C%22%2C%5C%22noob_level%5C%22%3Anull%2C%5C%22internal_referer%5C%22%3Anull%2C%5C%22user_id%5C%22%3A0%2C%5C%22page%5C%22%3A%5C%22front%5C%22%2C%5C%22_category_%5C%22%3A%5C%22client_event%5C%22%2C%5C%22ts%5C%22%3A" + ts + "%7D%22%5D&redirect_after_login="******"https://twitter.com/sessions?phx=1"), PostData, "https://twitter.com/", "" , this.userAgent);

                //string ts = GenerateTimeStamp();
                string get_twitter_first = string.Empty;
                try
                {
                    get_twitter_first = httpHelper.getHtmlfromUrlProxy(new Uri("https://twitter.com/"), "", proxyAddress, 0, proxyUsername, proxyPassword, "");
                }
                catch (Exception ex)
                {
                    //string get_twitter_first = globusHttpHelper1.getHtmlfromUrlp(new Uri("http://twitter.com/"), string.Empty, string.Empty);
                    //Thread.Sleep(1000);
                    get_twitter_first = httpHelper.getHtmlfromUrlProxy(new Uri("https://twitter.com/"), "", proxyAddress, 0, proxyUsername, proxyPassword, "");
                }

                string postAuthenticityToken = "";

                int startIndx = get_twitter_first.IndexOf("postAuthenticityToken");
                if (startIndx > 0)
                {
                    int indexstart = startIndx + "postAuthenticityToken".Length + 3;
                    int endIndx    = get_twitter_first.IndexOf("\"", startIndx);

                    postAuthenticityToken = get_twitter_first.Substring(startIndx, endIndx - startIndx).Replace(",", "");

                    if (postAuthenticityToken.Contains("postAuthenticityToken"))
                    {
                        try
                        {
                            string[] getOuthentication = System.Text.RegularExpressions.Regex.Split(get_twitter_first, "\"postAuthenticityToken\":\"");
                            string[] authenticity      = System.Text.RegularExpressions.Regex.Split(getOuthentication[1], ",");

                            if (authenticity[0].IndexOf("\"") > 0)
                            {
                                int    indexStart1 = authenticity[0].IndexOf("\"");
                                string start       = authenticity[0].Substring(0, indexStart1);
                                postAuthenticityToken = start.Replace("\"", "").Replace(":", "");
                            }
                        }
                        catch { };
                    }
                }
                else
                {
                    string[] array = System.Text.RegularExpressions.Regex.Split(get_twitter_first, "<input type=\"hidden\"");
                    foreach (string item in array)
                    {
                        if (item.Contains("authenticity_token"))
                        {
                            int startindex = item.IndexOf("value=\"");
                            if (startindex > 0)
                            {
                                string start    = item.Substring(startindex).Replace("value=\"", "");
                                int    endIndex = start.IndexOf("\"");
                                string end      = start.Substring(0, endIndex);
                                postAuthenticityToken = end;
                                break;
                            }
                        }
                    }
                }

                string get_twitter_second = httpHelper.postFormData(new Uri("https://twitter.com/scribe"), "log%5B%5D=%7B%22event_name%22%3A%22web%3Amobile_gallery%3Agallery%3A%3A%3Aimpression%22%2C%22noob_level%22%3Anull%2C%22internal_referer%22%3Anull%2C%22context%22%3A%22mobile_gallery%22%2C%22event_info%22%3A%22mobile_app_download%22%2C%22user_id%22%3A0%2C%22page%22%3A%22mobile_gallery%22%2C%22_category_%22%3A%22client_event%22%2C%22ts%22%3A" + ts + "%7D", "https://twitter.com/?lang=en&logged_out=1#!/download", "", ""); //globusHttpHelper.getHtmlfromUrl(new Uri("https://twitter.com/account/bootstrap_data?r=0.21632839148912897"), "https://twitter.com/", string.Empty);

                string get2nd = httpHelper.getHtmlfromUrlProxy(new Uri("http://twitter.com/account/bootstrap_data?r=0.21632839148912897"), "https://twitter.com/", proxyAddress, 0, proxyUsername, proxyPassword, "");

                string get_api = httpHelper.getHtmlfromUrl(new Uri("http://api.twitter.com/receiver.html"), "https://twitter.com/", "", "");


                //Old postdata
                //string postData = "session%5Busername_or_email%5D=" + Username + "&session%5Bpassword%5D=" + Password + "&scribe_log=%5B%22%7B%5C%22event_name%5C%22%3A%5C%22web%3Afront%3Alogin_callout%3Aform%3A%3Alogin_click%5C%22%2C%5C%22noob_level%5C%22%3Anull%2C%5C%22internal_referer%5C%22%3Anull%2C%5C%22user_id%5C%22%3A0%2C%5C%22page%5C%22%3A%5C%22front%5C%22%2C%5C%22_category_%5C%22%3A%5C%22client_event%5C%22%2C%5C%22ts%5C%22%3A" + ts + "%7D%22%5D&redirect_after_login="******"session%5Busername_or_email%5D=" + TwitterUsername + "&session%5Bpassword%5D=" + TwitterPassword + "&scribe_log=&redirect_after_login=&authenticity_token=" + postAuthenticityToken + "";

                string response_Login = httpHelper.postFormData(new Uri("https://twitter.com/sessions"), postData, "https://twitter.com/", "", "");


                string AfterPostPageContent = httpHelper.getHtmlfromUrl(new Uri("https://twitter.com/"), "https://twitter.com/", "", this.userAgent);

                if (AfterPostPageContent.Contains("signout-button"))
                {
                    string InvitePageContent = httpHelper.getHtmlfromUrl(new Uri(InviteUrl), "", "", this.userAgent);

                    if (InvitePageContent.Contains("This invite code is not valid"))
                    {
                        IsAccountCreated = false;
                        Log("[ " + DateTime.Now + " ] => [ This invite code is not valid " + PinEmail + " ]");
                        return(IsAccountCreated);
                    }

                    string InvitedPageContent = httpHelper.getHtmlfromUrl(new Uri("http://pinterest.com/twitter/?invited=1"), InviteUrl, "", this.userAgent);

                    if (InvitedPageContent.Contains("Logout"))
                    {
                        IsAccountCreated = true;
                        Log("[ " + DateTime.Now + " ] => [ This twitter account allready added with pinterest " + TwitterUsername + " ]");
                        return(IsAccountCreated);
                    }

                    Uri ResponseUri = httpHelper.GetResponseData();


                    if (!string.IsNullOrEmpty(ResponseUri.OriginalString))
                    {
                        if (ResponseUri.OriginalString.Contains("verify_captcha/?"))
                        {
                            //List<string> lstData = GetCapctha();
                            //string challenge = string.Empty;
                            //string response = string.Empty;


                            //challenge = lstData[0].ToString();
                            //response = lstData[1].ToString();
                            //response = response.Replace(" ", "+");
                            //string postUrl = "http://pinterest.com/verify_captcha/?src=register&return=%2Fwelcome%2F";
                            //string postData = "challenge=" + challenge + "&response=" + response;

                            //string POstResponse = httpHelper.postFormData(new Uri(postUrl), postData, "", string.Empty);

                            //string pageSrcWelcome = httpHelper.getHtmlfromUrl(new Uri("http://pinterest.com/welcome/"), postUrl, "");
                        }
                        if (ResponseUri.OriginalString.Contains("http://pinterest.com/twitter/?oauth_token"))
                        {
                            OAuthVerifier = ResponseUri.OriginalString;

                            int    FirstPointToken     = InvitedPageContent.IndexOf("csrfmiddlewaretoken");
                            string FirstTokenSubString = InvitedPageContent.Substring(FirstPointToken);

                            int SecondPointToken = FirstTokenSubString.IndexOf("/>");
                            PinToken = FirstTokenSubString.Substring(0, SecondPointToken).Replace("csrfmiddlewaretoken", string.Empty).Replace("value=", string.Empty).Replace("'", string.Empty).Trim();
                        }
                        if (ResponseUri.OriginalString.Contains("api.twitter.com/oauth/authenticate?oauth_token="))
                        {
                            int FirstAuthenticityPoint = InvitedPageContent.IndexOf("authenticity_token\" type=\"hidden\"");

                            string FirstSubAuthenticity = InvitedPageContent.Substring(FirstAuthenticityPoint);
                            OAuthenticityToken = FirstSubAuthenticity.Substring(FirstSubAuthenticity.IndexOf("value="), (FirstSubAuthenticity.IndexOf("/></div>")) - (FirstSubAuthenticity.IndexOf("value="))).Replace("value=", string.Empty).Replace("\"", string.Empty).Trim();

                            OAuthToken = ResponseUri.OriginalString.Replace("https://api.twitter.com/oauth/authenticate?oauth_token=", string.Empty).Replace("http://api.twitter.com/oauth/authenticate?oauth_token=", string.Empty);

                            string AcceptPostData = "authenticity_token=" + OAuthenticityToken + "&oauth_token=" + OAuthToken;

                            string OauthUrl = "https://twitter.com/oauth/authenticate?oauth_token=" + OAuthToken;

                            string AcceptedPageContent = httpHelper.postFormData(new Uri("https://twitter.com/oauth/authenticate"), AcceptPostData, OauthUrl, string.Empty, this.userAgent);

                            int FirstOAuthVerifierPoint = AcceptedPageContent.IndexOf("http://pinterest.com/twitter/?oauth_token=");

                            string FirstSuboAuth = AcceptedPageContent.Substring(FirstOAuthVerifierPoint);

                            OAuthVerifier = FirstSuboAuth.Substring(0, FirstSuboAuth.IndexOf(">")).Replace("\"", string.Empty).Trim();//.Replace("&oauth_verifier=", string.Empty).Trim();

                            string PinterestRegistrationPageContent = httpHelper.getHtmlfromUrl(new Uri(OAuthVerifier), string.Empty, string.Empty, this.userAgent);

                            if (!PinterestRegistrationPageContent.Contains("Oops! We are having some issues talking to Twitter. Please try again later"))
                            {
                                int    FirstPointToken     = PinterestRegistrationPageContent.IndexOf("csrfmiddlewaretoken");
                                string FirstTokenSubString = PinterestRegistrationPageContent.Substring(FirstPointToken);

                                int SecondPointToken = FirstTokenSubString.IndexOf("/>");
                                PinToken = FirstTokenSubString.Substring(0, SecondPointToken).Replace("csrfmiddlewaretoken", string.Empty).Replace("value=", string.Empty).Replace("'", string.Empty).Trim();
                            }
                            else
                            {
                                Log("[ " + DateTime.Now + " ] => [ We are having some issues talking to Twitter. Please try again later ]");
                                return(false);
                            }
                        }


                        //Checking For User Name
                        string CheckUserNameUrl = "http://pinterest.com/check_username/?check_username="******"&csrfmiddlewaretoken=" + PinToken;
                        string User             = httpHelper.getHtmlfromUrl(new Uri(CheckUserNameUrl), OAuthVerifier, PinToken, this.userAgent);

                        if (User.Contains("username is already"))
                        {
                            int num = RandomNumberGenerator.GenerateRandom(100, 1000);

                            PinUserName = PinUserName + num.ToString();

                            //Checking For User Name
                            CheckUserNameUrl = "http://pinterest.com/check_username/?check_username="******"&csrfmiddlewaretoken=" + PinToken;
                            User             = httpHelper.getHtmlfromUrl(new Uri(CheckUserNameUrl), OAuthVerifier, PinToken, this.userAgent);
                        }

                        ////Checking For User Name
                        //string CheckEmailUrl = "http://pinterest.com/check_username/?check_email=" + PinEmail + "&csrfmiddlewaretoken=" + PinToken;
                        //string Email = httpHelper.getHtmlfromUrl(new Uri(CheckEmailUrl), OAuthVerifier, PinToken);

                        //if (!Email.Contains("success"))
                        //{
                        //    //IsPinLoggedIn = true;
                        //    Log("This email not valid " + PinEmail);
                        //    return;
                        //}
                        string RegistrationPostData = "username="******"&email=" + PinEmail + "&password="******"&invite=" + InviteCode.Replace(" ", "").Replace("http://email.pinterest.com/wf/click&upn=", "") + "&twitter=1&csrfmiddlewaretoken=" + PinToken + "&user_image=http%3A%2F%2Fimg.tweetimag.es%2Fi%2FSocioPro_o";

                        string RegistredPageContent = httpHelper.postFormData(new Uri("http://pinterest.com/register/"), RegistrationPostData, OAuthVerifier, string.Empty, this.userAgent);

                        if (RegistredPageContent.Contains("recaptcha/api/js/recaptcha"))
                        {
                            List <string> lstData   = GetCapctha();
                            string        challenge = string.Empty;
                            string        response  = string.Empty;


                            challenge = lstData[0].ToString();
                            response  = lstData[1].ToString();
                            response  = response.Replace(" ", "+");
                            string postUrl   = "http://pinterest.com/verify_captcha/?src=register&return=/welcome/";
                            string postData1 = "challenge=" + challenge + "&response=" + response;

                            string POstResponse = httpHelper.postFormData(new Uri(postUrl), postData1, OAuthVerifier, PinToken, this.userAgent);

                            RegistredPageContent = httpHelper.getHtmlfromUrl(new Uri("http://pinterest.com/welcome/"), "", "", this.userAgent);
                        }
                        if (RegistredPageContent.Contains("architecture"))
                        {
                            IsAccountCreated = true;
                            Log("[ " + DateTime.Now + " ] => [ Account Created " + PinUserName + " ]");
                        }
                        else
                        {
                            IsAccountCreated = false;
                            Log("[ " + DateTime.Now + " ] => [ Account Not Created " + PinUserName + " ]");
                            return(IsAccountCreated);
                        }

                        string WelcomPageContent = httpHelper.postFormData(new Uri("http://pinterest.com/welcome/"), "", OAuthVerifier, PinToken, this.userAgent);

                        //Changed By  Gargi On 22nd May 2012 --> request from fiddler changed
                        //string CategoryPostData = "categories=architecture&user_follow=true";

                        string CategoryPostData = "categories=art%2Ccars_motorcycles%2Cdesign%2Cdiy_crafts%2Ceducation%2Carchitecture%2Cfitness";

                        string CategoryPageContent = httpHelper.postFormData(new Uri("http://pinterest.com/welcome/"), CategoryPostData, "http://pinterest.com/welcome/", PinToken, this.userAgent);

                        if (CategoryPageContent.Contains("success"))
                        {
                            IsAccountCreated = true;
                            Log("[ " + DateTime.Now + " ] => [ Initial Category Added " + PinUserName + " ]");
                        }

                        string AllowUserPostData = "follow_users%5B%5D=sharp&follow_users%5B%5D=neillehepworth&follow_users%5B%5D=miamalm&follow_users%5B%5D=kiluka&follow_users%5B%5D=gaileguevara&follow_users%5B%5D=jellway&follow_users%5B%5D=richard_larue&follow_users%5B%5D=rayestudio&follow_users%5B%5D=jdraper&follow_users%5B%5D=shashashasha";
                        //if (string.IsNullOrEmpty(ApplicationData.UsersToFollow))
                        //{
                        //    AllowUserPostData = "follow_users%5B%5D=sharp&follow_users%5B%5D=neillehepworth&follow_users%5B%5D=miamalm&follow_users%5B%5D=kiluka&follow_users%5B%5D=gaileguevara&follow_users%5B%5D=jellway&follow_users%5B%5D=richard_larue&follow_users%5B%5D=rayestudio&follow_users%5B%5D=jdraper&follow_users%5B%5D=shashashasha";
                        //}
                        //else
                        //{
                        //    AllowUserPostData = ApplicationData.UsersToFollow;
                        //}

                        string AlloweduserPostData = httpHelper.postFormData(new Uri("http://pinterest.com/welcome/"), AllowUserPostData, "http://pinterest.com/welcome/", PinToken, this.userAgent);

                        if (AlloweduserPostData.Contains("success"))
                        {
                            IsAccountCreated = true;
                            Log("[ " + DateTime.Now + " ] => [ Intial User Added " + PinUserName + " ]");
                        }

                        string BordPostData = "board_names%5B%5D=Products+I+Love&board_names%5B%5D=Favorite+Places+%26+Spaces&board_names%5B%5D=Books+Worth+Reading&board_names%5B%5D=My+Style&board_names%5B%5D=For+the+Home";

                        string BoardPostedPageContent = httpHelper.postFormData(new Uri("http://pinterest.com/welcome/"), BordPostData, "http://pinterest.com/welcome/", PinToken, this.userAgent);

                        if (BoardPostedPageContent.Contains("success"))
                        {
                            IsAccountCreated = true;
                            Log("[ " + DateTime.Now + " ] => [ Intial Board Added " + PinUserName + " ]");
                        }
                    }

                    return(IsAccountCreated);
                }
                else
                {
                    Log("[ " + DateTime.Now + " ] => [ Twitter Account Not Logged In :" + TwitterUsername + " ]");
                    return(IsAccountCreated);
                }
            }
            catch (Exception ex)
            {
                //Log("Error " + ex.Message);
                return(IsAccountCreated);
            }
        }
コード例 #22
0
        public List<string> GetUserFollowing(string UserName, int NoOfPage, int FollowingCount)
        {
            try
            {
                string FollowUrl = string.Empty;
                string AppVersion = string.Empty;
                string bookmark = string.Empty;
                string referer = string.Empty;
                string User = string.Empty;
                List<string> followings = new List<string>();
                ClGlobul.lstTotalUserScraped.Clear();
                List<string> lstFollowing = new List<string>();
				GlobusLogHelper.log.Info("[ " + DateTime.Now + "] => [ Starting Extraction Of Following For " + UserName + " ]");
                GlobusHttpHelper globusHttpHelper = new GlobusHttpHelper();

                string TotalFollowingUrl = "https://pinterest.com/" + UserName;
                string responseFollowingUrl = globusHttpHelper.getHtmlfromUrl(new Uri(TotalFollowingUrl), referer, string.Empty, "");
                int TotalFollowing = int.Parse(Utils.Utils.getBetween(responseFollowingUrl, "following_count\":", ","));
                int PageCount = TotalFollowing / 12 + 1;

                for (int i = 1; i <= PageCount; i++)
                {
                    try
                    {
                        string FollowerPageSource = string.Empty;

                        if (i == 1)
                        {
                            FollowUrl = "http://pinterest.com/" + UserName + "/following/";
                            FollowerPageSource = globusHttpHelper.getHtmlfromUrl(new Uri(FollowUrl), referer, string.Empty, "");
                            referer = FollowUrl;
                        }
                        else
                        {
                            FollowUrl = "https://pinterest.com/resource/UserFollowingResource/get/?source_url=%2F" + UserName + "%2Ffollowing%2F&data=%7B%22options%22%3A%7B%22username%22%3A%22" + UserName + "%22%2C%22bookmarks%22%3A%5B%22" + bookmark + "%3D%22%5D%7D%2C%22context%22%3A%7B%7D%7D&module_path=App(module%3D%5Bobject+Object%5D)&_=144204352215" + (i - 1);

                            try
                            {
                                FollowerPageSource = globusHttpHelper.getHtmlfromUrlProxy(new Uri(FollowUrl), referer, "", 80, string.Empty, "", "");
                            }
                            catch
                            {
                                FollowerPageSource = globusHttpHelper.getHtmlfromUrlProxy(new Uri(FollowUrl), "", Convert.ToInt32(""), "", "");

                            }
                            if (FollowerPageSource.Contains("Whoops! We couldn't find that page."))
                            {
                                break;
                            }
                        }

                        ///Get App Version 
                        if (FollowerPageSource.Contains("app_version") && string.IsNullOrEmpty(AppVersion))
                        {
                            string[] ArrAppVersion = System.Text.RegularExpressions.Regex.Split(FollowerPageSource, "app_version");
                            if (ArrAppVersion.Count() > 0)
                            {
                                string DataString = ArrAppVersion[ArrAppVersion.Count() - 1];

                                int startindex = DataString.IndexOf("\": \"");
                                int endindex = DataString.IndexOf("\", \"");

                                AppVersion = DataString.Substring(startindex, endindex - startindex).Replace("\": \"", "");
                            }
                        }

                        ///get bookmarks value from page 
                        ///
                        if (FollowerPageSource.Contains("bookmarks"))
                        {
                            string[] bookmarksDataArr = System.Text.RegularExpressions.Regex.Split(FollowerPageSource, "bookmarks");

                            string Datavalue = string.Empty;
                            if (bookmarksDataArr.Count() > 2)
                                Datavalue = bookmarksDataArr[bookmarksDataArr.Count() - 2];
                            else
                                Datavalue = bookmarksDataArr[bookmarksDataArr.Count() - 1];

                            bookmark = Datavalue.Substring(Datavalue.IndexOf(": [\"") + 4, Datavalue.IndexOf("]") - Datavalue.IndexOf(": [\"") - 5);
                        }


                        try
                        {
                            if (!FollowerPageSource.Contains("No one has followed"))
                            {
                                List<string> lst = objGlobusRegex.GetHrefUrlTags(FollowerPageSource);
                                if (lst.Count == 0)
                                {
                                    lst = System.Text.RegularExpressions.Regex.Split(FollowerPageSource, "href").ToList();
                                    if (lst.Count() == 1)
                                    {
                                        lst = System.Text.RegularExpressions.Regex.Split(FollowerPageSource, "\"username\":").ToList();
                                    }
                                }
                                foreach (string item in lst)
                                {
                                    if (item.Contains("class=\"userWrapper") || item.Contains("class=\\\"userWrapper"))
                                    {
                                        try
                                        {
                                            if (item.Contains("\\"))
                                            {
                                                int FirstPinPoint = item.IndexOf("=\\\"/");
                                                int SecondPinPoint = item.IndexOf("/\\\"");
                                                User = item.Substring(FirstPinPoint, SecondPinPoint - FirstPinPoint).Replace("\"", string.Empty).Replace("\\", string.Empty).Replace("=", string.Empty).Replace("/", string.Empty).Trim();
                                            }
                                            else
                                            {
                                                int FirstPinPoint = item.IndexOf("href=");
                                                int SecondPinPoint = item.IndexOf("class=");

                                                User = item.Substring(FirstPinPoint, SecondPinPoint - FirstPinPoint).Replace("\"", string.Empty).Replace("href=", string.Empty).Replace("/", string.Empty).Trim();
                                            }
                                            if (followings.Count == FollowingCount)
                                            {
                                                break;
                                            }
                                            followings.Add(User);


                                            //GlobusLogHelper.log.Info(" => [ " + User + " ]");                                           

                                        }
                                        catch (Exception ex)
                                        {
                                            GlobusLogHelper.log.Error(" Error : " + ex.StackTrace);
                                        }
                                    }
                                    if (i > 1)
                                    {
                                        if (item.Contains("\"request_identifier\":"))
                                        {
                                            continue;
                                        }
                                        else
                                        {
                                            try
                                            {
                                                User = Utils.Utils.getBetween(item, "\"", "\"");
                                                if (User == UserName)
                                                {
                                                    break;
                                                }
                                                followings.Add(User);

                                                //GlobusLogHelper.log.Info(" => [ " + User + " ]");

                                                if (followings.Count == FollowingCount)
                                                {
                                                    break;
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error(" Error : " + ex.StackTrace);
                                            }
                                        }
                                    }
                                }


                                followings = followings.Distinct().ToList();
                                foreach (string lstdata in followings)
                                {
                                    lstFollowing.Add(lstdata);
                                    #region AccountReport

                                    //string module = "Scraper";
                                    //string status = "Following";
                                    //qm.insertAccReportScrapeUser(module, lstdata, status, DateTime.Now);
                                    //objScraperDelegate();

                                    #endregion
                                    if (lstFollowing.Count >= maxNoOfRePinCount)
                                    {
                                        break;
                                    }
                                }
                                ClGlobul.lstTotalUserScraped = lstFollowing.Distinct().ToList();
                                if (ClGlobul.lstTotalUserScraped.Count >= maxNoOfRePinCount)
                                {
                                    return ClGlobul.lstTotalUserScraped;
                                }

                                Thread.Sleep(1000);
                            }
                            else
                            {
								GlobusLogHelper.log.Info("[ " + DateTime.Now + "] => [ No following ]");
                                break;
                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
                        break;

                    }
                }
				GlobusLogHelper.log.Info("[ " + DateTime.Now + "] => [ Total Followings : " + ClGlobul.lstTotalUserScraped.Count + " ]");            
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
            }

            return ClGlobul.lstTotalUserScraped;
        }
コード例 #23
0
ファイル: ProfileManager.cs プロジェクト: ondrocks/inboard
        public void SummaryEdit()
        {
            try
            {
                int    proxyport   = 888;
                string SummaryLink = string.Empty;

                Regex PortCheck = new Regex("^[0-9]*$");

                if (PortCheck.IsMatch(_ProxyPort) && !string.IsNullOrEmpty(_ProxyPort))
                {
                    proxyport = int.Parse(_ProxyPort);
                }
                string PgSrcProfile = string.Empty;

                //For going to LinkedIn  Profile Likn
                PgSrcProfile = HttpHelper.getHtmlfromUrlProxy(new Uri("http://www.linkedin.com/profile/edit?trk=tab_pro"), _ProxyAddress, proxyport, _ProxyUserName, _ProxyPassword);

                if (PgSrcProfile.Contains("/profile/edit-summary"))
                {
                    string SummaryLinkTemp = PgSrcProfile.Substring(PgSrcProfile.IndexOf("/profile/edit-summary"), 200);

                    string[] Arr = SummaryLinkTemp.Split('"');

                    SummaryLink = Arr[0];

                    SummaryLink = "http://www.linkedin.com" + SummaryLink;

                    //string DecodedCharTest = Uri.UnescapeDataString(SummaryLink);
                    SummaryLink = Uri.UnescapeDataString(SummaryLink);
                    SummaryLink = SummaryLink.Replace("amp;", "");
                }

                string pgSrcProfileSummaryEdit = HttpHelper.getHtmlfromUrlProxy(new Uri(SummaryLink), _ProxyAddress, proxyport, _ProxyUserName, _ProxyPassword);

                //** Post Data For Summary Edit in profile ***************************************************************

                string postData           = string.Empty;
                string postUrl            = string.Empty;
                string expertise_comments = string.Empty;
                string specialties        = string.Empty;
                string csrfToken          = string.Empty;
                string sourceAlias        = string.Empty;
                string goback             = string.Empty;

                // For goback ** post data
                if (SummaryLink.Contains("goback"))
                {
                    string[] ArrgoBacek = SummaryLink.Split('=');
                    goback = ArrgoBacek[2];
                }

                // For csrfToken ** post data
                string[] ArrCsrfToken = Regex.Split(pgSrcProfileSummaryEdit, "input");
                foreach (string item in ArrCsrfToken)
                {
                    if (!item.Contains("<!DOCTYPE"))
                    {
                        if (item.Contains("csrfToken") && item.Contains("value="))
                        {
                            csrfToken = item;
                            break;
                        }
                    }
                }


                if (csrfToken.Contains("csrfToken"))
                {
                    csrfToken = csrfToken.Substring(csrfToken.IndexOf("csrfToken"));
                    string[] Arr = csrfToken.Split('"');
                    csrfToken = Arr[2];
                    csrfToken = csrfToken.Replace(":", "%3A");
                }

                // For sourceAlias ** post data
                if (pgSrcProfileSummaryEdit.Contains("sourceAlias"))
                {
                    sourceAlias = pgSrcProfileSummaryEdit.Substring(pgSrcProfileSummaryEdit.IndexOf("sourceAlias"), 100);
                    string[] Arr = sourceAlias.Split('"');
                    sourceAlias = Arr[2];
                }


                // For expertise_comments ** post data
                expertise_comments = _SummaryGoals.Replace(" ", "%20");

                // For specialties ** post data
                specialties = _SummarySpecialties.Replace(" ", "%20");

                //Post Data for Summary_Edit in profile
                postData = "expertise_comments=" + expertise_comments + "&specialties=" + specialties + "&button=Save%20Changes&locale=en_US&nudgeID=&timestamp=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias + "&goback=" + goback;


                //Post Uri for Summary_Edit in profile
                postUrl = "http://www.linkedin.com/profile/editSummarySubmit";

                //Post Response
                string postResponse = HttpHelper.postFormDataProxy(new Uri(postUrl), postData, _ProxyAddress, proxyport, _ProxyUserName, _ProxyPassword);

                if (postResponse.Contains("Your professional summary has been updated"))
                {
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
コード例 #24
0
        public List<string> GetUserFollowing_newComment(string UserName, int NoOfPage, int FollowingCount)
        {
            List<string> TotalFollowerComment = new List<string>();
            try
            {            
                List<string> FollowerComment = new List<string>();
				GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ Starting Extraction Of Following For " + UserName + " ]");
                GlobusHttpHelper objglobusHttpHelper = new GlobusHttpHelper();
                for (int i = 1; i <= 1000; i++)
                {
                    try
                    {
                        string FollowerPageSource = string.Empty;

                        if (i == 1)
                        {
                            FollowUrl = "http://pinterest.com/" + UserName + "/following/";
                            FollowerPageSource = objglobusHttpHelper.getHtmlfromUrl(new Uri(FollowUrl), referer, string.Empty, "");
                            referer = FollowUrl;
                        }
                        else
                        {
                            FollowUrl = "https://www.pinterest.com/resource/UserFollowingResource/get/?source_url=%2F" + UserName + "%2Ffollowing%2F&data=%7B%22options%22%3A%7B%22username%22%3A%22" + UserName + "%22%2C%22bookmarks%22%3A%5B%22" + bookmark + "%3D%22%5D%7D%2C%22context%22%3A%7B%7D%7D&module_path=App(module%3D%5Bobject+Object%5D)&_=144204352215" + (i - 1);

                            try
                            {
                                FollowerPageSource = objglobusHttpHelper.getHtmlfromUrlProxy(new Uri(FollowUrl), referer, "", 80, string.Empty, "", "");
                            }
                            catch
                            {
                                FollowerPageSource = objglobusHttpHelper.getHtmlfromUrlProxy(new Uri(FollowUrl), "", Convert.ToInt32(""), "", "");

                            }
                            if (FollowerPageSource.Contains("Whoops! We couldn't find that page."))
                            {
                                break;
                            }
                        }

                        ///Get App Version 
                        if (FollowerPageSource.Contains("app_version") && string.IsNullOrEmpty(AppVersion))
                        {
                            string[] ArrAppVersion = System.Text.RegularExpressions.Regex.Split(FollowerPageSource, "app_version");
                            if (ArrAppVersion.Count() > 0)
                            {
                                string DataString = ArrAppVersion[ArrAppVersion.Count() - 1];

                                int startindex = DataString.IndexOf("\": \"");
                                int endindex = DataString.IndexOf("\", \"");

                                AppVersion = DataString.Substring(startindex, endindex - startindex).Replace("\": \"", "");
                            }
                        }

                        ///get bookmarks value from page 
                        ///
                        if (FollowerPageSource.Contains("bookmarks"))
                        {
                            string[] bookmarksDataArr = System.Text.RegularExpressions.Regex.Split(FollowerPageSource, "bookmarks");

                            string Datavalue = string.Empty;
                            if (bookmarksDataArr.Count() > 2)
                                Datavalue = bookmarksDataArr[bookmarksDataArr.Count() - 2];
                            else
                                Datavalue = bookmarksDataArr[bookmarksDataArr.Count() - 1];

                            bookmark = Datavalue.Substring(Datavalue.IndexOf(": [\"") + 4, Datavalue.IndexOf("]") - Datavalue.IndexOf(": [\"") - 5);
                        }


                        try
                        {
                            if (!FollowerPageSource.Contains("No one has followed"))
                            {
                                List<string> lst = objGlobusRegex.GetHrefUrlTags(FollowerPageSource);
                                if (lst.Count == 0)
                                {
                                    lst = System.Text.RegularExpressions.Regex.Split(FollowerPageSource, "href").ToList();
                                    if (lst.Count() == 1)
                                    {
                                        lst = System.Text.RegularExpressions.Regex.Split(FollowerPageSource, "\"username\":").ToList();
                                    }
                                }
                                foreach (string item in lst)
                                {
                                    if (item.Contains("class=\"userWrapper") || item.Contains("class=\\\"userWrapper"))
                                    {
                                        try
                                        {
                                            if (item.Contains("\\"))
                                            {
                                                int FirstPinPoint = item.IndexOf("=\\\"/");
                                                int SecondPinPoint = item.IndexOf("/\\\"");
                                                User = item.Substring(FirstPinPoint, SecondPinPoint - FirstPinPoint).Replace("\"", string.Empty).Replace("\\", string.Empty).Replace("=", string.Empty).Replace("/", string.Empty).Trim();
                                            }
                                            else
                                            {
                                                int FirstPinPoint = item.IndexOf("href=");
                                                int SecondPinPoint = item.IndexOf("class=");

                                                User = item.Substring(FirstPinPoint, SecondPinPoint - FirstPinPoint).Replace("\"", string.Empty).Replace("href=", string.Empty).Replace("/", string.Empty).Trim();
                                            }

                                            FollowerComment.Add(User);
                                        
                                            //GlobusLogHelper.log.Info(" => [ " + User + " ]");                                           
                                            if (FollowerComment.Count == FollowingCount)
                                            {
                                                break;
                                            }
                                        }
                                        catch (Exception ex)
                                        {
                                            GlobusLogHelper.log.Error(" Error : " + ex.StackTrace);
                                        }
                                    }
                                    if (i > 1)
                                    {
                                        if (item.Contains("\"request_identifier\":"))
                                        {
                                            continue;
                                        }
                                        else
                                        {
                                            try
                                            {
                                                User = Utils.Utils.getBetween(item, "\"", "\"");
                                                if (User == UserName)
                                                {
                                                    break;
                                                }
                                                FollowerComment.Add(User);
                                              
                                                //GlobusLogHelper.log.Info(" => [ " + User + " ]");

                                                if (FollowerComment.Count == FollowingCount)
                                                {
                                                    break;
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error(" Error : " + ex.StackTrace);
                                            }
                                        }
                                    }
                                }


                                FollowerComment = FollowerComment.Distinct().ToList();
                                foreach (string lstdata in FollowerComment)
                                {
                                    TotalFollowerComment.Add(lstdata);

                                }
                                TotalFollowerComment = TotalFollowerComment.Distinct().ToList();
                                //if (TotalFollowerComment.Count == MaxComment)
                                //{
                                //    break;
                                //}
                                Thread.Sleep(1000);
                            }
                            else
                            {
								GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ No following ]");
                                break;
                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
                        break;

                    }
                }

                //GlobusLogHelper.log.Info(" => [ Finished Extracting following For " + UserName + " ]");
                //GlobusLogHelper.log.Info(" => [ Process Completed Please. Now you can export file ]");
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
            }

			GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ Total Followings : " + TotalFollowerComment.Count + " ]");

            return TotalFollowerComment;
        }
コード例 #25
0
        public void Login(ref GlobusHttpHelper httpHelper)
        {
            try
            {
                this.httpHelper = httpHelper;

                if (string.IsNullOrEmpty(proxyPort))
                {
                    proxyPort = "0";
                }
                //string _MainSourcePage = httpHelper.getHtmlfromUrl(new Uri("https://pinterest.com/login/"), string.Empty, string.Empty, this.UserAgent);
                string _MainSourcePage = httpHelper.getHtmlfromUrlProxy(new Uri("https://pinterest.com/login/"), "", proxyAddress, int.Parse(proxyPort), proxyUsername, proxyPassword, "");


                ///Get App Version 
                if (_MainSourcePage.Contains("app_version"))
                {
                    string[] ArrAppVersion = System.Text.RegularExpressions.Regex.Split(_MainSourcePage, "app_version");
                    if (ArrAppVersion.Count() > 0)
                    {
                        string DataString = ArrAppVersion[ArrAppVersion.Count() - 1];

                        int startindex = DataString.IndexOf("\"");
                        string start = DataString.Substring(startindex).Replace("\": \"", "").Replace("\"", string.Empty);
                        int endindex = start.IndexOf("}");

                        App_version = start.Substring(0, endindex);
                    }
                }
                else
                {
                    ///App version is not available in page source 
                }


                string referer = "https://www.pinterest.com/login/";

                //string PostData = "source_url=%2Flogin%2F&data=%7B%22options%22%3A%7B%22username_or_email%22%3A%22" + Uri.EscapeDataString(Username) + "%22%2C%22password%22%3A%22" + Password + "%22%7D%2C%22context%22%3A%7B%22app_version%22%3A%22" + App_version + "%22%7D%7D&module_path%3DApp()%3ELoginPage()%3ELogin()%3EButton(class_name%3Dprimary%2C%20text%3DLog%20in%2C%20type%3Dsubmit%2C%20size%3Dlarge)";
                string PostData = "source_url=%2Flogin%2F&data=%7B%22options%22%3A%7B%22username_or_email%22%3A%22" + Uri.EscapeDataString(Username) + "%22%2C%22password%22%3A%22" + Password + "%22%7D%2C%22context%22%3A%7B%22app_version%22%3A%22" + App_version + "%22%2C%22https_exp%22%3Afalse%7D%7D&module_path=App()%3ELoginPage()%3ELogin()%3EButton(class_name%3Dprimary%2C+text%3DLog+in%2C+type%3Dsubmit%2C+size%3Dlarge)";
                //PostData = "source_url=%2Fsettings%2F&data=%7B%22options%22%3A%7B%22first_name%22%3A%22abhay%22%2C%22last_name%22%3A%22mahavar%22%2C%22username%22%3A%22"++"%22%2C%22about%22%3A%22hi+i+am+software+Developer%22%2C%22location%22%3A%22kanpur%22%2C%22website_url%22%3A%22http%3A%2F%2Fwww.scriptnut.com%2F%22%7D%2C%22context%22%3A%7B%22app_version%22%3A%22b1da8fc%22%2C%22https_exp%22%3Afalse%7D%7D&module_path=App()%3EUserSettingsPage(resource%3DUserSettingsResource())%3EShowModalButton(module%3DUserEdit)%23Modal(module%3DUserEdit(resource%3DUserSettingsResource()))";
                string login = httpHelper.postFormDataProxy(new Uri("https://www.pinterest.com/resource/UserSessionResource/create/"), PostData, referer, proxyAddress, int.Parse(proxyPort), proxyUsername, proxyPassword);

                string AfterLoginPageSource = httpHelper.getHtmlfromUrlProxy(new Uri("https://www.pinterest.com"), "", proxyAddress, int.Parse(proxyPort), proxyUsername, proxyPassword, "");

                if (AfterLoginPageSource.Contains("Logout") || AfterLoginPageSource.Contains("pinHolder"))
                {
                    Log("[ " + DateTime.Now + " ] => [ Successfully Login for " + Username + " ]");
                    this.LoggedIn = true;

                }
                else
                {
                    Log("[ " + DateTime.Now + " ] => [ Login Failed for " + Username + " ]");
                    this.LoggedIn = false;
                }


                //List<string> listFollowersFromDatabse = new List<string>();
                try
                {
                    List<string> listFollowersFromDatabse = new List<string>();
                    try
                    {
                        string screen_Name = Getscreen_Name();
                        string selectquery = "Select * from  tb_FollowerName where UserName='******'";
                        System.Data.DataSet ds = DataBaseHandler.SelectQuery(selectquery, "tb_FollowerName");

                        foreach (System.Data.DataRow dRow in ds.Tables[0].Rows)
                        {
                            try
                            {
                                listFollowersFromDatabse.Add(dRow["FollwerName"].ToString());
                            }
                            catch { }

                        }
                    }
                    catch { }

                    try
                    {
                        FrmEmailProxyAssigner obj = new FrmEmailProxyAssigner();

                        string screen_Name = Getscreen_Name();

                        //Get current followers list from website
                        List<string> FollowersName = GetRefrshFollowerName(screen_Name);

                        //FollowersName.RemoveAt(0);

                        if (FollowersName != null)
                        {
                            FollowersName = FollowersName.Distinct().ToList();
                        }
                        if (FollowersName.Contains(screen_Name))
                        {
                            FollowersName.Remove(screen_Name);
                        }
                        //listFollowersFromDatabse.Add("gunde");
                        List<string> listUnfollowers = listFollowersFromDatabse.Except(FollowersName).ToList();

                        LogForFollow(listUnfollowers.Count + " users Unfollowed Account : " + screen_Name);

                        string UnfollowersList = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\PInterestUnfollowersList.csv";

                        //write unfollowers list to csv
                        if (!System.IO.File.Exists(UnfollowersList))                                                             //*     CSV Header     *//
                        {
                            try
                            {
                                string dataFormat = "Account_ScreenName" + "," + "UnfollowerUsername";
                                GlobusFileHelper.AppendStringToTextfileNewLine(dataFormat, UnfollowersList); //dataFormat
                            }
                            catch (Exception ex) { };
                        }

                        foreach (string unfollower in listUnfollowers)
                        {
                            try
                            {
                                string dataFormat = screen_Name + "," + unfollower;
                                GlobusFileHelper.AppendStringToTextfileNewLine(dataFormat, UnfollowersList); //dataFormat

                                LogForFollow("Unfollower : " + unfollower + " for Account : " + screen_Name + " written to file " + UnfollowersList);
                            }
                            catch (Exception ex) { };

                            try
                            {
                                string query = "DELETE FROM  tb_FollowerName where UserName='******' and FollwerName='" + unfollower + "'";
                                DataBaseHandler.DeleteQuery(query, "tb_FollowerName");

                                LogForFollow("Unfollower : " + unfollower + " for Account : " + screen_Name + " deleted from Databse");
                            }
                            catch { }
                        }

                        List<string> listNewFollowers = FollowersName.Except(listFollowersFromDatabse).ToList();

                        LogForFollow(listNewFollowers.Count + " NEW Followers for Account : " + screen_Name + "");

                        foreach (string follName_item in listNewFollowers)
                        {
                            try
                            {
                                string query = "INSERT INTO  tb_FollowerName (UserName,FollwerName) VALUES ('" + screen_Name + "' ,'" + follName_item + "') ";
                                DataBaseHandler.InsertQuery(query, "tb_FollowerName");

                                LogForFollow("New follower : " + follName_item + " for Account : " + screen_Name + " added to Databse");
                            }
                            catch { }

                        }

                        string follower = GetFollowercount(screen_Name);
                        string following = GetFollowingCount(screen_Name);
                        string BOARDS = GetBoard(screen_Name);
                        string BoardsName = string.Empty;
                        List<string> BOARDSNAMES = obj.GetAllBoardNames_new1(screen_Name);

                        //string BOARDSNAME = GetBoardsNAME(screen_Name);


                        foreach (string item_BoardNames in BOARDSNAMES)
                        {
                            //string insertBoard = "INSERT INTO tb_BoardName(UserName,BoardsName)VALUES('" + Username + "','" + item_BoardNames + "')";
                            // DataBaseHandler.InsertQuery(insertBoard, "tb_BoardName");

                            BoardsName += item_BoardNames + (":").ToString();
                        }

                        string UpdateQuery = "Update tb_emails set Follower = '" + follower + "',Following = '" + following + "',BOARDS= '" + BOARDS + "',BOARDSNAME='" + BoardsName + "' where UserName = '******'";
                        DataBaseHandler.UpdateQuery(UpdateQuery, "tb_emails");
                    }

                    catch { }

                    string[] ArrData = System.Text.RegularExpressions.Regex.Split(AfterLoginPageSource, "username");

                    foreach (var item in ArrData)
                    {
                        if (item.Contains("{\"page_info"))
                        {
                            continue;
                        }
                        if (!item.StartsWith("\": null,") && !item.StartsWith("{\"request_identifier\""))
                        {
                            int startindex = item.IndexOf(":");
                            int endindex = item.IndexOf("\", \"");

                            this.Name = item.Substring(startindex + 1, endindex - startindex).Replace("id=\"UserNav\"", string.Empty).Replace("a ", string.Empty).Replace("<", string.Empty).Replace(">", string.Empty).Replace("'", string.Empty).Replace("href=", string.Empty).Replace("\"", string.Empty).Replace("/", string.Empty).Trim();
                            break;
                        }
                        if (item.Contains("locale"))// && item.Contains("P.currentUser.set"))
                        {
                            int startindex = item.IndexOf(":");
                            int endindex = item.IndexOf("\", \"");

                            this.Name = item.Substring(startindex + 1, endindex - startindex).Replace("id=\"UserNav\"", string.Empty).Replace("a ", string.Empty).Replace("<", string.Empty).Replace(">", string.Empty).Replace("'", string.Empty).Replace("href=", string.Empty).Replace("\"", string.Empty).Replace("/", string.Empty).Trim();
                            break;
                        }
                        else if (item.Contains("name\": \"AuthHomePage"))
                        {
                            int startindex = item.IndexOf(":");
                            int endindex = item.IndexOf("\", \"");

                            this.Name = item.Substring(startindex + 1, endindex - startindex).Replace("\"", string.Empty).Trim();
                        }
                    }
                    if (ArrData.Count() == 2 && string.IsNullOrEmpty(Name))
                    {
                        int startindex = ArrData[1].IndexOf(":");
                        int endindex = ArrData[1].IndexOf("\", \"");

                        this.Name = ArrData[1].Substring(startindex + 1, endindex - startindex).Replace("id=\"UserNav\"", string.Empty).Replace("a ", string.Empty).Replace("<", string.Empty).Replace(">", string.Empty).Replace("'", string.Empty).Replace("href=", string.Empty).Replace("\"", string.Empty).Replace("/", string.Empty).Trim();
                    }


                }
                catch (Exception ex)
                {
                    this.Name = string.Empty;
                }
            }
            catch { };
        }
コード例 #26
0
        /// <summary>
        /// Returns Captcha Image from Facebook
        /// </summary>
        /// <param name="responseMessage"></param>
        /// <returns></returns>
        public string GetCaptchaImageMulti(string email, ref GlobusHttpHelper HttpHelper, ref string post_form_id, ref string lsd,
           ref string reg_instance,
           ref string firstname,
           ref string lastname,
           ref string reg_email__,
           ref string reg_email_confirmation__,
           ref string reg_passwd__,
           ref string sex,
           ref string birthday_month,
           ref string birthday_day,
           ref string birthday_year,
           ref string captcha_persist_data,
           ref string captcha_session,
           ref string extra_challenge_params,
           ref string recaptcha_public_key,
           ref string authp_pisg_nonce_tt,
           ref string authp,
           ref string psig,
           ref string nonce,
           ref string tt,
           ref string time,
           ref string challenge,
           ref string CaptchaSummit)
        {
            string proxyAddress = string.Empty;
            string proxyPort = string.Empty;
            string proxyUsername = string.Empty;
            string proxyPassword = string.Empty;

            string FirstName = string.Empty;
            string LastName = string.Empty;
            string Email = string.Empty;
            string Password = string.Empty;
            string DOB = string.Empty;

            Email = email.Split(':')[0];
            Password = email.Split(':')[1];

            if (email.Split(':').Length > 5)
            {
                proxyAddress = email.Split(':')[2];
                proxyPort = email.Split(':')[3];
                proxyUsername = email.Split(':')[4];
                proxyPassword = email.Split(':')[5];
                //AddToListBox("Setting proxy " + proxyAddress + ":" + proxyPort);
            }
            else if (email.Split(':').Length == 4)
            {
                //MessageBox.Show("Private proxies not loaded with emails \n Accounts will be created with public proxies");
                proxyAddress = email.Split(':')[2];
                proxyPort = email.Split(':')[3];
            }

            if (listFirstName.Count > 0)
            {
                try
                {
                    FirstName = listFirstName[RandomNumberGenerator.GenerateRandom(0, listFirstName.Count)];
                }
                catch (Exception ex)
                {
                    FirstName = string.Empty;
                }
            }
            if (listLastName.Count > 0)
            {
                try
                {
                    LastName = listLastName[RandomNumberGenerator.GenerateRandom(0, listLastName.Count)];
                }
                catch (Exception ex)
                {
                    LastName = string.Empty;
                }
            }

           


            #region Get Params

            //string post_form_id = string.Empty;
            //string lsd = string.Empty;
            //string reg_instance = string.Empty;
            //string firstname = string.Empty;
            //string lastname = string.Empty;
            //string reg_email__ = string.Empty;
            //string reg_email_confirmation__ = string.Empty;
            //string reg_passwd__ = string.Empty;
            //string sex = string.Empty;
            //string birthday_month = string.Empty;
            //string birthday_day = string.Empty;
            //string birthday_year = string.Empty;
            //string captcha_persist_data = string.Empty;
            //string captcha_session = string.Empty;
            //string extra_challenge_params = string.Empty;
            //string recaptcha_public_key = string.Empty;
            //string authp_pisg_nonce_tt = null;
            //string authp = string.Empty;
            //string psig = string.Empty;
            //string nonce = string.Empty;
            //string tt = string.Empty;
            //string time = string.Empty;
            //string challenge = string.Empty;
            //string CaptchaSummit = string.Empty;

            int intProxyPort = 80;
            Regex IdCheck = new Regex("^[0-9]*$");

            if (!string.IsNullOrEmpty(proxyPort) && IdCheck.IsMatch(proxyPort))
            {
                intProxyPort = int.Parse(proxyPort);
            }

            AddToListBox("Fetching Captcha");
            LogFacebookCreator("Fetching Captcha");
            //GlobusHttpHelper HttpHelper = new GlobusHttpHelper();  //Create new instance

            string pageSource = HttpHelper.getHtmlfromUrlProxy(new Uri("http://www.facebook.com/"), proxyAddress, intProxyPort, proxyUsername, proxyPassword);


            #region CSS, JS, & Pixel requests to avoid Socket Detection

            ///JS, CSS, Image Requests
            //RequestJSCSSIMG(pageSource, ref HttpHelper);
            RequestsJSCSSIMG.RequestJSCSSIMG(pageSource, ref HttpHelper);


            //try
            //{
            //    string req1 = HttpHelper.getHtmlfromUrl(new Uri("http://static.ak.fbcdn.net/rsrc.php/v1/yC/r/6n91uRFZJAi.js"));
            //}
            //catch (Exception)
            //{
            //}
            //try
            //{
            //    string req2 = HttpHelper.getHtmlfromUrl(new Uri("http://static.ak.fbcdn.net/rsrc.php/v1/yd/r/dpT-tcRYFZy.js"));
            //}
            //catch (Exception)
            //{
            //}

            ///Pixel request
            string reg_instanceValue = GetParamValue(pageSource, "reg_instance");
            //string asyncSignal = RandomNumberGenerator.GenerateRandom(3000, 4000).ToString();
            string asyncSignal = string.Empty;
            try
            {
                asyncSignal = RandomNumberGenerator.GenerateRandom(3000, 8000).ToString();
            }
            catch (Exception)
            {


            }
            string pixel = HttpHelper.getHtmlfromUrl(new Uri("http://pixel.facebook.com/ajax/register/logging.php?action=form_focus&reg_instance=" + reg_instanceValue + "&asyncSignal=" + asyncSignal + "&__user=0"));
            #endregion



            //Delay after loading Sign Up
            //Thread.Sleep(12000);

            //string Response1 = HttpHelper.postFormDataProxy(new Uri("http://ocsp.digicert.com/"), "", proxyAddress, intProxyPort, proxyUsername, proxyPassword);

            //string Response12 = HttpHelper.postFormDataProxy(new Uri("http://ocsp.digicert.com/"), "", proxyAddress, intProxyPort, proxyUsername, proxyPassword);

            //string pageSource12 = HttpHelper.getHtmlfromUrlProxy(new Uri("http://static.ak.fbcdn.net/rsrc.php/v1/yS/r/STeWPW2kh0m.png"), proxyAddress, intProxyPort, proxyUsername, proxyPassword);

            //**** update by ritesh 20-9-11  *****/////////////////////////////////

            //*** For post_form_id ********////////////////////////////////////////////////
            AddToListBox("searching the captcha data" + Email);
            if (pageSource.Contains("post_form_id"))
            {
                string post_id = pageSource.Substring(pageSource.IndexOf("post_form_id"), 200);
                string[] Arr1 = post_id.Split('"');
                post_form_id = Arr1[2];
            }
            if (pageSource.Contains("lsd"))
            {
                string lsd_val = pageSource.Substring(pageSource.IndexOf("lsd"), 100);
                string[] Arr_lsd = lsd_val.Split('"');
                lsd = Arr_lsd[2];
            }
            if (pageSource.Contains("reg_instance"))
            {
                string reg_instance_val = pageSource.Substring(pageSource.IndexOf("reg_instance"), 200);
                string[] Arr_reg = reg_instance_val.Split('"');
                reg_instance = Arr_reg[4];
            }
            firstname = FirstName.Replace(" ", "%20");
            lastname = LastName.Replace(" ", "%20");
            reg_email__ = Email.Replace("@", "%40");
            reg_email_confirmation__ = Email.Replace("@", "%40");
            reg_passwd__ = Password.Replace("@", "%40");
            sex = SexSelect;
            birthday_month = RandomNumberGenerator.GenerateRandom(1, 12).ToString();
            birthday_day = RandomNumberGenerator.GenerateRandom(1, 28).ToString();
            birthday_year = RandomNumberGenerator.GenerateRandom(1980, 1990).ToString();


            if (pageSource.Contains("captcha_persist_data"))
            {
                string captcha_persist_data_val = pageSource.Substring(pageSource.IndexOf("captcha_persist_data"), 500);
                string[] Arr_captcha_persist_data_val = captcha_persist_data_val.Split('"');
                captcha_persist_data = Arr_captcha_persist_data_val[4];
            }
            if (pageSource.Contains("captcha_session"))
            {
                string captcha_session_val = pageSource.Substring(pageSource.IndexOf("captcha_session"), 200);
                string[] Arr_captcha_session_val = captcha_session_val.Split('"');
                captcha_session = Arr_captcha_session_val[4];
            }
            if (pageSource.Contains("extra_challenge_params"))
            {
                string extra_challenge_params_val = pageSource.Substring(pageSource.IndexOf("extra_challenge_params"), 500);
                string[] Arr_extra_challenge_params_val = extra_challenge_params_val.Split('"');
                authp_pisg_nonce_tt = Arr_extra_challenge_params_val[4];
                extra_challenge_params = Arr_extra_challenge_params_val[4];
                extra_challenge_params = extra_challenge_params.Replace("=", "%3D");
                extra_challenge_params = extra_challenge_params.Replace("&amp;", "%26");
            } 
             
            #endregion

            //AddToListBox("get the first url" + Email);

            ///Delay after filling info
            //int delay = 0;
            //try
            //{
            //    delay = RandomNumberGenerator.GenerateRandom(minDelay, maxDelay) * 1000;
            //    if (delay < 4000)
            //    {
            //        delay = RandomNumberGenerator.GenerateRandom(8000, 12000);
            //    }
            //}
            //catch (Exception)
            //{
            //}

            //AddToListBox("Delaying for " + delay / 1000 + " seconds");
            //Thread.Sleep(delay);
            //Thread.Sleep(RandomNumberGenerator.GenerateRandom(4000, 8000));


            //////////////////////////////*****Gets Captcha URL****////////////////////////////////////////////////
            string pageSourceCaptcha = HttpHelper.getHtmlfromUrl(new Uri("https://www.facebook.com/ajax/register.php?__a=4&post_form_id=" + post_form_id + "&lsd=" + lsd + "&reg_instance=" + reg_instance + "&locale=en_US&terms=on&abtest_registration_group=1&referrer=&md5pass=&validate_mx_records=1&ab_test_data=&firstname=" + firstname + "&lastname=" + lastname + "&reg_email__=" + reg_email__ + "&reg_email_confirmation__=" + reg_email_confirmation__ + "&reg_passwd__=" + reg_passwd__ + "&sex=" + sex + "&birthday_month=" + birthday_month + "&birthday_day=" + birthday_day + "&birthday_year=" + birthday_year + "&captcha_persist_data=" + captcha_persist_data + "&captcha_session=" + captcha_session + "&extra_challenge_params=" + extra_challenge_params + "&recaptcha_type=password&captcha_response=&ignore=captcha%7Cpc&__user=0"));

            //JS, CSS, Image Requests
            RequestsJSCSSIMG.RequestJSCSSIMG(pageSourceCaptcha, ref HttpHelper);

            if (!pageSourceCaptcha.Contains("There is an existing account associated with this email"))
            {

                if (pageSource.Contains("RegUtil.recaptcha_public_key"))
                {
                    string recaptcha_public_key_val = pageSource.Substring(pageSource.IndexOf("RegUtil.recaptcha_public_key"), 200);
                    string[] Arr_recaptcha_public_key = recaptcha_public_key_val.Split('"');
                    recaptcha_public_key = Arr_recaptcha_public_key[1];
                }
                if (authp_pisg_nonce_tt != null)
                {
                    string[] ArrpisgTemp = authp_pisg_nonce_tt.Split('=');
                    authp = ArrpisgTemp[1];
                    authp = authp.Replace("&amp;psig", "");
                    psig = ArrpisgTemp[2];
                    psig = psig.Replace("&amp;nonce", "");
                    nonce = ArrpisgTemp[3];
                    nonce = nonce.Replace("&amp;tt", "");
                    tt = ArrpisgTemp[4];
                    tt = tt.Replace("&amp;time", "");
                    time = ArrpisgTemp[5];
                    time = time.Substring(0, 10);
                }

                AddToListBox("loading captcha" + Email);

                string pageSourceCaptcha1 = HttpHelper.getHtmlfromUrl(new Uri("http://www.google.com/recaptcha/api/challenge?k=" + recaptcha_public_key + "&ajax=1&xcachestop=0.4159115800857506&authp=" + authp + "&psig=" + psig + "&nonce=" + nonce + "&tt=" + tt + "&time=" + time + "&new_audio_default=1"));

                ////JS, CSS, Image Requests
                //RequestsJSCSSIMG.RequestJSCSSIMG(pageSourceCaptcha1, ref HttpHelper);

                // string challenge = string.Empty;
                if (pageSourceCaptcha1.Contains("challenge"))
                {

                    string challenge_val = pageSourceCaptcha1.Substring(pageSourceCaptcha1.IndexOf("challenge"), 300);
                    string[] Arr_challenge = challenge_val.Split('\'');
                    challenge = Arr_challenge[1];
                }

                return "http://www.google.com/recaptcha/api/image?c=" + challenge;
                //string pageSourceCaptcha2 = HttpHelper.getHtmlfromUrlImage(new Uri("http://www.google.com/recaptcha/api/image?c=" + challenge)); 
            }
            else
            {
                //responseMessage = "There is an existing account with " + Email;
                AddToListBox("There is an existing account with " + Email);
                return null;
            }
        }
コード例 #27
0
        public bool LoginPinterestAccount1(ref GlobusHttpHelper httpHelper, string Username, string Password, string proxyAddress, string proxyPort, string proxyUsername, string proxyPassword,string ss)
        {
            lock (this)
            {
                string Name = string.Empty;
                string ProxyAddress = proxyAddress;
                string ProxyPort = proxyPort;
                string ProxyUsername = proxyUsername;
                string ProxyPassword = proxyPassword;
                string AfterLoginPageSource = string.Empty;
                try
                {
                    //string PinPage = httpHelper.getHtmlfromUrl(new Uri("https://www.pinterest.com/"));
                    string PinPage = httpHelper.getHtmlfromUrlProxy(new Uri("https://www.pinterest.com/"), ProxyAddress, Convert.ToInt32(proxyPort), proxyUsername, proxyPassword);
                    //string _MainSourcePage = httpHelper.getHtmlfromUrl(new Uri("https://www.pinterest.com/resource/NoopResource/get/?source_url=%2Flogin%2F%3Fnext%3Dhttps%253A%252F%252Fwww.pinterest.com%252F%26prev%3Dhttps%253A%252F%252Fwww.pinterest.com%252F&data=%7B%22options%22%3A%7B%7D%2C%22context%22%3A%7B%7D%7D&module_path=App()%3EHomePage()%3EUnauthHomePage(signup_email%3Dnull%2C+tab%3Dfollowing%2C+cmp%3Dnull%2C+resource%3DInspiredWallResource())&_=1424169081757"));
                    string _MainSourcePage = httpHelper.getHtmlfromUrlProxy(new Uri("https://www.pinterest.com/resource/NoopResource/get/?source_url=%2Flogin%2F%3Fnext%3Dhttps%253A%252F%252Fwww.pinterest.com%252F%26prev%3Dhttps%253A%252F%252Fwww.pinterest.com%252F&data=%7B%22options%22%3A%7B%7D%2C%22context%22%3A%7B%7D%7D&module_path=App()%3EHomePage()%3EUnauthHomePage(signup_email%3Dnull%2C+tab%3Dfollowing%2C+cmp%3Dnull%2C+resource%3DInspiredWallResource())&_=1424169081757"), proxyAddress, Convert.ToInt32(proxyPort), proxyUsername, proxyPassword);
                    //string _MainSourcePage = httpHelper.getHtmlfromUrl(new Uri("https://www.pinterest.com/resource/NoopResource/get/?source_url=%2Flogin%2F%3Faction%3Dlogin%26next%3Dhttps%253A%252F%252Fwww.pinterest.com%252F%26prev%3Dhttps%253A%252F%252Fwww.pinterest.com%252F%26referrer%3Dhome_page&data=%7B%22options%22%3A%7B%7D%2C%22context%22%3A%7B%7D%7D&module_path=App%3EHomePage%3EUnauthLoggedOutHomePage%3ELoginButton(class_name%3DloggedOutHomePageLogin%2C+text%3DLog+in%2C+element_type%3Da)&_=1437811789975"));

                    ///Get App Version 
                    if (PinPage.Contains("app_version"))
                    {
                        try
                        {
                            string[] ArrAppVersion = System.Text.RegularExpressions.Regex.Split(PinPage, "app_version");
                            if (ArrAppVersion.Count() > 0)
                            {
                                string DataString = ArrAppVersion[ArrAppVersion.Count() - 1];

                                int startindex = DataString.IndexOf("\"");
                                string start = DataString.Substring(startindex).Replace("\": \"", "").Replace("}", string.Empty).Replace("\"", string.Empty);
                                int endindex = start.IndexOf(",");

                                App_version = start.Substring(0, endindex);
                            }
                        }
                        catch { };
                    }
                    else
                    {
                        ///App version is not available in page source 
                    }


                    string referer = "https://www.pinterest.com/";

                    string PostData1 = "source_url=%2Flogin%2F%3Fnext%3Dhttps%253A%252F%252Fwww.pinterest.com%252F%26prev%3Dhttps%253A%252F%252Fwww.pinterest.com%252F&data=%7B%22options%22%3A%7B%22username_or_email%22%3A%22" + Uri.EscapeDataString(Username) + "%22%2C%22password%22%3A%22" + Uri.EscapeDataString(Password) + "%22%7D%2C%22context%22%3A%7B%7D%7D&module_path=App()%3ELoginPage()%3ELogin()%3EButton(text%3DLog+In%2C+size%3Dlarge%2C+class_name%3Dprimary%2C+type%3Dsubmit)";
                    //string PostData1 = "source_url=%2Flogin%2F%3Fnext%3Dhttps%253A%252F%252Fwww.pinterest.com%252F%26prev%3Dhttps%253A%252F%252Fwww.pinterest.com%252F&data=%7B%22options%22%3A%7B%22username_or_email%22%3A%22" + Uri.EscapeDataString(Username) + "%22%2C%22password%22%3A%22" + Uri.EscapeDataString(Password) + "%22%7D%2C%22context%22%3A%7B%7D%7D&module_path=App()%3ELoginPage()%3ELogin()%3EButton(text%3DLog+In%2C+size%3Dlarge%2C+class_name%3Dprimary%2C+type%3Dsubmit)";
                    //PostData = "source_url=%2Fsettings%2F&data=%7B%22options%22%3A%7B%22first_name%22%3A%22abhay%22%2C%22last_name%22%3A%22mahavar%22%2C%22username%22%3A%22"++"%22%2C%22about%22%3A%22hi+i+am+software+Developer%22%2C%22location%22%3A%22kanpur%22%2C%22website_url%22%3A%22http%3A%2F%2Fwww.scriptnut.com%2F%22%7D%2C%22context%22%3A%7B%22app_version%22%3A%22b1da8fc%22%2C%22https_exp%22%3Afalse%7D%7D&module_path=App()%3EUserSettingsPage(resource%3DUserSettingsResource())%3EShowModalButton(module%3DUserEdit)%23Modal(module%3DUserEdit(resource%3DUserSettingsResource()))";

                    //string PostData1 = "source_url=%2Flogin%2F%3Faction%3Dlogin%26next%3Dhttps%253A%252F%252Fwww.pinterest.com%252F%26prev%3Dhttps%253A%252F%252Fwww.pinterest.com%252F%26referrer%3Dhome_page&data=%7B%22options%22%3A%7B%22username_or_email%22%3A%22" + Uri.EscapeDataString(Username) + "%22%2C%22password%22%3A%22" + Uri.EscapeDataString(Password) + " %22%7D%2C%22context%22%3A%7B%7D%7D&module_path=App%3ELoginPage%3ELogin%3EButton(text%3DLog+in%2C+size%3Dlarge%2C+class_name%3Dprimary%2C+type%3Dsubmit)";


                    //string login = httpHelper.postFormDataProxyPin(new Uri("https://www.pinterest.com/resource/UserSessionResource/create/"), PostData1, referer);
                    string login = httpHelper.postFormDataProxy(new Uri("https://www.pinterest.com/resource/UserSessionResource/create/"), PostData1, referer, proxyAddress, Convert.ToInt32(proxyPort), proxyUsername, proxyPassword);

                   //  string CheckLogin = httpHelper.postFormDataProxy(new Uri("https://www.pinterest.com/resource/UserSessionResource/create/"), PostData1, referer, ProxyAddress, int.Parse(ProxyUsername), ProxyPassword, ProxyPort);

                     //AfterLoginPageSource = httpHelper.getHtmlfromUrl(new Uri("https://www.pinterest.com"));
                     AfterLoginPageSource = httpHelper.getHtmlfromUrlProxy(new Uri("https://www.pinterest.com"), proxyAddress, Convert.ToInt32(proxyPort), proxyUsername, proxyPassword);

                    if (AfterLoginPageSource.Contains("Logout") || AfterLoginPageSource.Contains("pinHolder") || AfterLoginPageSource.Contains("header1\": \"What are you interested in?") || AfterLoginPageSource.Contains("\"error\": null") || login.Contains("\"error\": null"))
                    {
                        Log("[ " + DateTime.Now + " ] => [ Successfully Login for " + Username + " ]");
                        this.LoggedIn = true;

                        //GlobusLogHelper.log.Debug("[ Social Sites => Pinterest => Account Creator => [ Successfully Login for " + Username + " ]");
                        //GlobusLogHelper.log.Info("[ Social Sites => Pinterest => Account Creator => [ Successfully Login for " + Username + " ]");
                        //this.LoggedIn = true;
                        //return true;
                    }
                    else
                    {
                        Log("[ " + DateTime.Now + " ] => [ Login Failed for " + Username + " ]");
                        this.LoggedIn = false;

                        //GlobusLogHelper.log.Debug("[ Social Sites => Pinterest => Account Creator => [ Login Failed for " + Username + " ]");
                        //GlobusLogHelper.log.Info("[ Social Sites => Pinterest => Account Creator => [ Login Failed for " + Username + " ]");
                        //this.LoggedIn = false;
                        return false;
                    }
                }
                catch (Exception ex)
                {
                    Log("[ " + DateTime.Now + " ] => [ Login Failed for " + Username + " ]");
                    this.LoggedIn = false;

                    //GlobusLogHelper.log.Debug("[ Social Sites => Pinterest => Account Creator => [ Login Failed for " + Username + " ]");
                    //GlobusLogHelper.log.Info("[ Social Sites => Pinterest => Account Creator => [ Login Failed for " + Username + " ]");
                    //GlobusLogHelper.log.Error(ex.Message);
                    return false;
                }


                try
                {

                 //   string CheckWlcomeUrl = httpHelper.getHtmlfromUrl(new Uri("https://www.pinterest.com/"));


                    List<string> listFollowersFromDatabse = new List<string>();
                    try
                    {
                        string screen_Name = Getscreen_Name();
                        string selectquery = "Select * from  tb_FollowerName where UserName='******'";
                        System.Data.DataSet ds = DataBaseHandler.SelectQuery(selectquery, "tb_FollowerName");

                        foreach (System.Data.DataRow dRow in ds.Tables[0].Rows)
                        {
                            try
                            {
                                listFollowersFromDatabse.Add(dRow["FollwerName"].ToString());
                            }
                            catch { }

                        }
                    }
                    catch { }

                    try
                    {
                        FrmEmailProxyAssigner obj = new FrmEmailProxyAssigner();

                        string screen_Name = Getscreen_Name();
                        Screen_Name = screen_Name;
                        //Get current followers list from website
                        List<string> FollowersName = GetRefrshFollowerName(screen_Name);

                        //FollowersName.RemoveAt(0);

                        if (FollowersName != null)
                        {
                            FollowersName = FollowersName.Distinct().ToList();
                        }
                        if (FollowersName.Contains(screen_Name))
                        {
                            FollowersName.Remove(screen_Name);
                        }
                        //listFollowersFromDatabse.Add("gunde");
                        List<string> listUnfollowers = listFollowersFromDatabse.Except(FollowersName).ToList();

                        LogForFollow(listUnfollowers.Count + " users Unfollowed Account : " + screen_Name);

                        string UnfollowersList = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\PInterestUnfollowersList.csv";

                        //write unfollowers list to csv
                        if (!System.IO.File.Exists(UnfollowersList))                                                             //*     CSV Header     *//
                        {
                            try
                            {
                                string dataFormat = "Account_ScreenName" + "," + "UnfollowerUsername";
                                GlobusFileHelper.AppendStringToTextfileNewLine(dataFormat, UnfollowersList); //dataFormat
                            }
                            catch (Exception ex) { };
                        }

                        foreach (string unfollower in listUnfollowers)
                        {
                            try
                            {
                                string dataFormat = screen_Name + "," + unfollower;
                                GlobusFileHelper.AppendStringToTextfileNewLine(dataFormat, UnfollowersList); //dataFormat

                                LogForFollow("Unfollower : " + unfollower + " for Account : " + screen_Name + " written to file " + UnfollowersList);
                            }
                            catch (Exception ex) { };

                            try
                            {
                                string query = "DELETE FROM  tb_FollowerName where UserName='******' and FollwerName='" + unfollower + "'";
                                DataBaseHandler.DeleteQuery(query, "tb_FollowerName");

                                LogForFollow("Unfollower : " + unfollower + " for Account : " + screen_Name + " deleted from Databse");
                            }
                            catch { }
                        }

                        List<string> listNewFollowers = FollowersName.Except(listFollowersFromDatabse).ToList();

                        LogForFollow(listNewFollowers.Count + " NEW Followers for Account : " + screen_Name + "");

                        foreach (string follName_item in listNewFollowers)
                        {
                            try
                            {
                                string query = "INSERT INTO  tb_FollowerName (UserName,FollwerName) VALUES ('" + screen_Name + "' ,'" + follName_item + "') ";
                                DataBaseHandler.InsertQuery(query, "tb_FollowerName");

                                LogForFollow("New follower : " + follName_item + " for Account : " + screen_Name + " added to Databse");
                            }
                            catch { }

                        }

                        string follower = GetFollowercount(screen_Name);
                        string following = GetFollowingCount(screen_Name);
                        string BOARDS = GetBoard(screen_Name);


                        string followingCount = PinterestAccountManager.getBetween(following, "value'>", "</span>");



                        string BoardsName = string.Empty;
                        List<string> BOARDSNAMES = new List<string>();
                        if (frmMain.inviteStart)
                        {
                            BOARDSNAMES = obj.GetAllBoardNames_new1(screen_Name);

                            foreach (var itemBoardNames in BOARDSNAMES)
                            {
                                lstBoardNames.Add(itemBoardNames.ToLower().Replace(" ", "-"));
                            }
                        }
                        frmMain.inviteStart = true;

                        //string BOARDSNAME = GetBoardsNAME(screen_Name);

                        try
                        {
                            foreach (string item_BoardNames in BOARDSNAMES)
                            {
                                //string insertBoard = "INSERT INTO tb_BoardName(UserName,BoardsName)VALUES('" + Username + "','" + item_BoardNames + "')";
                                // DataBaseHandler.InsertQuery(insertBoard, "tb_BoardName");

                                BoardsName += item_BoardNames + (":").ToString();
                            }
                        }
                        catch { }

                        try
                        {
                            string UpdateQuery = "Update tb_emails set Follower = '" + follower + "',Following = '" + followingCount + "',BOARDS= '" + BOARDS + "',BOARDSNAME='" + BoardsName + "',ScreenName='" + screen_Name + "' where UserName = '******'";
                            DataBaseHandler.UpdateQuery(UpdateQuery, "tb_emails");
                            
                            new FrmEmailProxyAssigner().LoadDataGrid();
                            new FrmEmailProxyAssigner().makeReadOnlyDataGrid();

                        }
                        catch { }
                    }

                    catch { }

                    string[] ArrData = System.Text.RegularExpressions.Regex.Split(AfterLoginPageSource, "username");

                    foreach (var item in ArrData)
                    {
                        if (item.Contains("{\"page_info"))
                        {
                            continue;
                        }
                        if (!item.StartsWith("\": null,") && !item.StartsWith("{\"request_identifier\""))
                        {
                            int startindex = item.IndexOf(":");
                            int endindex = item.IndexOf("\", \"");

                            this.Name = item.Substring(startindex + 1, endindex - startindex).Replace("id=\"UserNav\"", string.Empty).Replace("a ", string.Empty).Replace("<", string.Empty).Replace(">", string.Empty).Replace("'", string.Empty).Replace("href=", string.Empty).Replace("\"", string.Empty).Replace("/", string.Empty).Trim();
                            break;
                        }
                        if (item.Contains("locale"))// && item.Contains("P.currentUser.set"))
                        {
                            int startindex = item.IndexOf(":");
                            int endindex = item.IndexOf("\", \"");

                            this.Name = item.Substring(startindex + 1, endindex - startindex).Replace("id=\"UserNav\"", string.Empty).Replace("a ", string.Empty).Replace("<", string.Empty).Replace(">", string.Empty).Replace("'", string.Empty).Replace("href=", string.Empty).Replace("\"", string.Empty).Replace("/", string.Empty).Trim();
                            break;
                        }
                        else if (item.Contains("name\": \"AuthHomePage"))
                        {
                            int startindex = item.IndexOf(":");
                            int endindex = item.IndexOf("\", \"");

                            this.Name = item.Substring(startindex + 1, endindex - startindex).Replace("\"", string.Empty).Trim();
                        }
                    }
                    if (ArrData.Count() == 2 && string.IsNullOrEmpty(Name))
                    {
                        int startindex = ArrData[1].IndexOf(":");
                        int endindex = ArrData[1].IndexOf("\", \"");

                        this.Name = ArrData[1].Substring(startindex + 1, endindex - startindex).Replace("id=\"UserNav\"", string.Empty).Replace("a ", string.Empty).Replace("<", string.Empty).Replace(">", string.Empty).Replace("'", string.Empty).Replace("href=", string.Empty).Replace("\"", string.Empty).Replace("/", string.Empty).Trim();
                    }
                }
                catch (Exception ex)
                {
                    this.Name = string.Empty;
                }
            }
            if (this.LoggedIn)
            {
                return true;
            }
            return false;
        }
コード例 #28
0
        //public bool LoginPinterestAccount1(ref PinInterestUser objPinUser, string Username, string Password, string proxyAddress, string proxyPort, string proxyUsername, string proxyPassword, string ss)
        //{
        //    try
        //    {
        //        lock (this)
        //        {
        //            GlobusHttpHelper globusHttpHelper=new GlobusHttpHelper();
        //            string Name = string.Empty;
        //            string ProxyAddress = proxyAddress;
        //            string ProxyPort = proxyPort;
        //            string ProxyUsername = proxyUsername;
        //            string ProxyPassword = proxyPassword;
        //            string AfterLoginPageSource = string.Empty;
        //            try
        //            {

        //                string PinPage = globusHttpHelper.getHtmlfromUrlProxy(new Uri("https://www.pinterest.com/"), ProxyAddress, 80, proxyUsername, proxyPassword);

        //                string _MainSourcePage = globusHttpHelper.getHtmlfromUrlProxy(new Uri("https://www.pinterest.com/resource/NoopResource/get/?source_url=%2Flogin%2F%3Fnext%3Dhttps%253A%252F%252Fwww.pinterest.com%252F%26prev%3Dhttps%253A%252F%252Fwww.pinterest.com%252F&data=%7B%22options%22%3A%7B%7D%2C%22context%22%3A%7B%7D%7D&module_path=App()%3EHomePage()%3EUnauthHomePage(signup_email%3Dnull%2C+tab%3Dfollowing%2C+cmp%3Dnull%2C+resource%3DInspiredWallResource())&_=1424169081757"), proxyAddress, 80, proxyUsername, proxyPassword);
            
        //                Get App Version 
        //                if (PinPage.Contains("app_version"))
        //                {
        //                    try
        //                    {
        //                        string[] ArrAppVersion = System.Text.RegularExpressions.Regex.Split(PinPage, "app_version");
        //                        if (ArrAppVersion.Count() > 0)
        //                        {
        //                            string DataString = ArrAppVersion[ArrAppVersion.Count() - 1];

        //                            int startindex = DataString.IndexOf("\"");
        //                            string start = DataString.Substring(startindex).Replace("\": \"", "").Replace("}", string.Empty).Replace("\"", string.Empty);
        //                            int endindex = start.IndexOf(",");

        //                            App_version = start.Substring(0, endindex);
        //                            if (!string.IsNullOrEmpty(App_version))
        //                            {
        //                                objPinUser.App_version = App_version;
        //                            }
        //                        }
        //                    }
        //                    catch { };
        //                }
        //                else
        //                {
        //                    App version is not available in page source 
        //                }


        //                string referer = "https://www.pinterest.com/";
        //                string login = string.Empty;
        //                try
        //                {

        //                    string PostData1 = "source_url=%2Flogin%2F%3Fnext%3Dhttps%253A%252F%252Fwww.pinterest.com%252F%26prev%3Dhttps%253A%252F%252Fwww.pinterest.com%252F&data=%7B%22options%22%3A%7B%22username_or_email%22%3A%22" + Uri.EscapeDataString(Username) + "%22%2C%22password%22%3A%22" + Uri.EscapeDataString(Password) + "%22%7D%2C%22context%22%3A%7B%7D%7D&module_path=App()%3ELoginPage()%3ELogin()%3EButton(text%3DLog+In%2C+size%3Dlarge%2C+class_name%3Dprimary%2C+type%3Dsubmit)";

        //                    login = globusHttpHelper.postFormDataProxy(new Uri("https://www.pinterest.com/resource/UserSessionResource/create/"), PostData1, referer, proxyAddress, 80, proxyUsername, proxyPassword);
        //                }
        //                catch { };
                       
        //                try
        //                {
        //                    AfterLoginPageSource = globusHttpHelper.getHtmlfromUrlProxy(new Uri("https://www.pinterest.com"), proxyAddress, 80, proxyUsername, proxyPassword);
        //                }
        //                catch (Exception ex)
        //                {
        //                }

        //                if (AfterLoginPageSource.Contains("Logout") || AfterLoginPageSource.Contains("pinHolder") || AfterLoginPageSource.Contains("header1\": \"What are you interested in?") || AfterLoginPageSource.Contains("\"error\": null") || login.Contains("\"error\": null"))
        //                {
        //                    objPinUser.globusHttpHelper = globusHttpHelper;
        //                    GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ Successfully Login for " + Username + " ]");
        //                    this.LoggedIn = true;

        //                }
        //                else
        //                {
        //                    GlobusLogHelper.log.Info(" => [ Login Failed for " + Username + " ]");
        //                    this.LoggedIn = false;
        //                    return false;
        //                }
        //            }
        //            catch (Exception ex)
        //            {
        //                GlobusLogHelper.log.Info(" => [ Login Failed for " + Username + " ]");
        //                this.LoggedIn = false;
        //                return false;
        //            }

        //            try
        //            {
        //                List<string> listFollowersFromDatabse = new List<string>();
        //                try
        //                {
        //                    string screen_Name = Getscreen_Name(ref objPinUser);
        //                    DataSet ds = QME.getFollower(screen_Name);
                         
        //                    foreach (System.Data.DataRow dRow in ds.Tables[0].Rows)
        //                    {
        //                        try
        //                        {
        //                            listFollowersFromDatabse.Add(dRow["FollwerName"].ToString());
        //                        }
        //                        catch (Exception ex)
        //                        { }
        //                    }
        //                }
        //                catch { }

        //                try
        //                {                            
        //                    string screen_Name = Getscreen_Name(ref objPinUser);
        //                    objPinUser.ScreenName = screen_Name;
        //                    Get current followers list from website
        //                    List<string> FollowersName = GetRefrshFollowerName(screen_Name, ref objPinUser);

        //                    FollowersName.RemoveAt(0);

        //                    if (FollowersName != null)
        //                    {
        //                        FollowersName = FollowersName.Distinct().ToList();
        //                    }
        //                    if (FollowersName.Contains(screen_Name))
        //                    {
        //                        FollowersName.Remove(screen_Name);
        //                    }
        //                    listFollowersFromDatabse.Add("gunde");
        //                    List<string> listUnfollowers = listFollowersFromDatabse.Except(FollowersName).ToList();

        //                    GlobusLogHelper.log.Info(listUnfollowers.Count + " users Unfollowed Account : " + screen_Name);

        //                    string UnfollowersList = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\PInterestUnfollowersList.csv";

        //                    write unfollowers list to csv
        //                    if (!System.IO.File.Exists(UnfollowersList))                                                             //*     CSV Header     *//
        //                    {
        //                        try
        //                        {
        //                            string dataFormat = "Account_ScreenName" + "," + "UnfollowerUsername";
        //                            GlobusFileHelper.AppendStringToTextfileNewLine(dataFormat, UnfollowersList); //dataFormat
        //                        }
        //                        catch (Exception ex) { };
        //                    }

        //                    foreach (string unfollower in listUnfollowers)
        //                    {
        //                        try
        //                        {
        //                            string dataFormat = screen_Name + "," + unfollower;
        //                            GlobusFileHelper.AppendStringToTextfileNewLine(dataFormat, UnfollowersList); //dataFormat

        //                            GlobusLogHelper.log.Info("Unfollower : " + unfollower + " for Account : " + screen_Name + " written to file " + UnfollowersList);
        //                        }
        //                        catch (Exception ex) 
        //                        { };

        //                        try
        //                        {
        //                            QueryExecuter.deleteFollower(screen_Name, unfollower);                                  
        //                            GlobusLogHelper.log.Info("Unfollower : " + unfollower + " for Account : " + screen_Name + " deleted from Databse");
        //                        }
        //                        catch (Exception ex)
        //                        { }
        //                    }

        //                    List<string> listNewFollowers = FollowersName.Except(listFollowersFromDatabse).ToList();

        //                    GlobusLogHelper.log.Info(listNewFollowers.Count + " NEW Followers for Account : " + screen_Name + "");

        //                    foreach (string follName_item in listNewFollowers)
        //                    {
        //                        try
        //                        {
        //                            QueryExecuter.insertFollowerName(screen_Name, follName_item);                                    
        //                            GlobusLogHelper.log.Info("New follower : " + follName_item + " for Account : " + screen_Name + " added to Databse");
        //                        }
        //                        catch { }
        //                    }

        //                    string follower = GetFollowercount(screen_Name, ref objPinUser);
        //                    string following = GetFollowingCount(screen_Name, ref objPinUser);
        //                    string BOARDS = GetBoard(screen_Name, ref objPinUser);

        //                    string followingCount = getBetween(following, "value'>", "</span>");

        //                    string BoardsName = string.Empty;
        //                    List<string> BOARDSNAMES = new List<string>();
        //                    if (inviteStart)
        //                    {
        //                        BOARDSNAMES = GetAllBoardNames_new1(screen_Name, ref objPinUser);
        //                        foreach (var itemBoardNames in BOARDSNAMES)
        //                        {
        //                            try
        //                            {
        //                                lstBoardNames.Add(itemBoardNames.ToLower().Replace(" ", "-"));
        //                            }
        //                            catch(Exception ex)
        //                            { };
        //                        }
        //                    }
        //                    inviteStart = true;

        //                    try
        //                    {
        //                        foreach (string item_BoardNames in BOARDSNAMES)
        //                        {                                
        //                            BoardsName += item_BoardNames + (":").ToString();
        //                        }
        //                    }
        //                    catch(Exception ex) 
        //                    { };

        //                    try
        //                    {
        //                       // QueryExecuter.updatetb_emails(follower, followingCount, BOARDS, BoardsName, screen_Name, Username);                              
        //                        objUploadAccount.AccounLoad();
        //                        objDelegateAccountLoad();
        //                    }
        //                    catch(Exception ex)
        //                    { };
        //                }

        //                catch(Exception ex)
        //                { };

        //                string[] ArrData = System.Text.RegularExpressions.Regex.Split(AfterLoginPageSource, "username");

        //                foreach (var item in ArrData)
        //                {
        //                    try
        //                    {
        //                        if (item.Contains("{\"page_info"))
        //                        {
        //                            continue;
        //                        }
        //                        if (!item.StartsWith("\": null,") && !item.StartsWith("{\"request_identifier\""))
        //                        {
        //                            int startindex = item.IndexOf(":");
        //                            int endindex = item.IndexOf("\", \"");

        //                            this.Name = item.Substring(startindex + 1, endindex - startindex).Replace("id=\"UserNav\"", string.Empty).Replace("a ", string.Empty).Replace("<", string.Empty).Replace(">", string.Empty).Replace("'", string.Empty).Replace("href=", string.Empty).Replace("\"", string.Empty).Replace("/", string.Empty).Trim();
        //                            break;
        //                        }
        //                        if (item.Contains("locale"))// && item.Contains("P.currentUser.set"))
        //                        {
        //                            int startindex = item.IndexOf(":");
        //                            int endindex = item.IndexOf("\", \"");

        //                            this.Name = item.Substring(startindex + 1, endindex - startindex).Replace("id=\"UserNav\"", string.Empty).Replace("a ", string.Empty).Replace("<", string.Empty).Replace(">", string.Empty).Replace("'", string.Empty).Replace("href=", string.Empty).Replace("\"", string.Empty).Replace("/", string.Empty).Trim();
        //                            break;
        //                        }
        //                        else if (item.Contains("name\": \"AuthHomePage"))
        //                        {
        //                            int startindex = item.IndexOf(":");
        //                            int endindex = item.IndexOf("\", \"");

        //                            this.Name = item.Substring(startindex + 1, endindex - startindex).Replace("\"", string.Empty).Trim();
        //                        }
        //                    }
        //                    catch (Exception ex)
        //                    { }
        //                }
        //                if (ArrData.Count() == 2 && string.IsNullOrEmpty(Name))
        //                {
        //                    try
        //                    {
        //                        int startindex = ArrData[1].IndexOf(":");
        //                        int endindex = ArrData[1].IndexOf("\", \"");

        //                        this.Name = ArrData[1].Substring(startindex + 1, endindex - startindex).Replace("id=\"UserNav\"", string.Empty).Replace("a ", string.Empty).Replace("<", string.Empty).Replace(">", string.Empty).Replace("'", string.Empty).Replace("href=", string.Empty).Replace("\"", string.Empty).Replace("/", string.Empty).Trim();
        //                    }
        //                    catch { };
        //                }
        //            }
        //            catch (Exception ex)
        //            {
        //                this.Name = string.Empty;
        //            }
        //        }
        //        if (this.LoggedIn)
        //        {
        //            return true;
        //        }
        //    }
        //    catch (Exception ex)
        //    {

        //    }
        //    return false;
        //}

        public bool LoginPinterestAccount1forlee(ref PinInterestUser objPinUser, string Username, string Password, string proxyAddress, string proxyPort, string proxyUsername, string proxyPassword, string ss)
        {
            try
            {
                if (!checkFirstTimeLicense)
                {
                    bool checkValideLicense = checkLoginTimeLicenseStatus();
                    if (!checkValideLicense)
                    {
                        GlobusLogHelper.log.Debug("-----------------------------------------------------");
                        GlobusLogHelper.log.Info(" Please Re-Start The Software !");
                        return false;
                    }
                }

                lock (this)
                {
                    GlobusHttpHelper globusHttpHelper = new GlobusHttpHelper();
                    string Name = string.Empty;
                    string ProxyAddress = proxyAddress;
                    string ProxyPort = proxyPort;
                    string ProxyUsername = proxyUsername;
                    string ProxyPassword = proxyPassword;
                    string LoginStatus = string.Empty;

                    string AfterLoginPageSource = string.Empty;
                    try
                    {

                        string PinPage = globusHttpHelper.getHtmlfromUrlProxy(new Uri("https://www.pinterest.com/"), ProxyAddress, int.Parse(proxyPort), proxyUsername, proxyPassword);

                       /// string _MainSourcePage = globusHttpHelper.getHtmlfromUrlProxy(new Uri("https://www.pinterest.com/resource/NoopResource/get/?source_url=%2Flogin%2F%3Fnext%3Dhttps%253A%252F%252Fwww.pinterest.com%252F%26prev%3Dhttps%253A%252F%252Fwww.pinterest.com%252F&data=%7B%22options%22%3A%7B%7D%2C%22context%22%3A%7B%7D%7D&module_path=App()%3EHomePage()%3EUnauthHomePage(signup_email%3Dnull%2C+tab%3Dfollowing%2C+cmp%3Dnull%2C+resource%3DInspiredWallResource())&_=1424169081757"), proxyAddress, Convert.ToInt32(proxyPort), proxyUsername, proxyPassword);                   
                        ///Get App Version 
                        if (PinPage.Contains("app_version"))
                        {
                            try
                            {
                                string[] ArrAppVersion = System.Text.RegularExpressions.Regex.Split(PinPage, "app_version");
                                if (ArrAppVersion.Count() > 0)
                                {
                                    string DataString = ArrAppVersion[ArrAppVersion.Count() - 1];

                                    int startindex = DataString.IndexOf("\"");
                                    string start = DataString.Substring(startindex).Replace("\": \"", "").Replace("}", string.Empty).Replace("\"", string.Empty);
                                    int endindex = start.IndexOf(",");

                                    App_version = start.Substring(0, endindex);
                                    if (!string.IsNullOrEmpty(App_version))
                                    {
                                        objPinUser.App_version = App_version;
                                    }
                                }
                            }
                            catch { };
                        }
                        else
                        {
                            ///App version is not available in page source 
                        }


                        string referer = "https://www.pinterest.com/";
                        string login = string.Empty;
                        try
                        {                         
                            string PostData1 = "source_url=%2F&data=%7B%22options%22%3A%7B%22username_or_email%22%3A%22" + Uri.EscapeDataString(Username) + "%22%2C%22password%22%3A%22" + Uri.EscapeDataString(Password) + "%22%7D%2C%22context%22%3A%7B%7D%7D&module_path=App%3EModalManager%3EModal%3EPlainSignupModal%3ESignupForm%3EUserRegister(next%3D%2F%2C+wall_class%3DgrayWall%2C+container%3Dplain_signup_modal%2C+unified_auth%3Dundefined%2C+is_login_form%3Dtrue%2C+show_personalize_field%3Dundefined%2C+auto_follow%3Dundefined%2C+register%3Dtrue)";
                            login = globusHttpHelper.postFormDataProxy(new Uri("https://www.pinterest.com/resource/UserSessionResource/create/"), PostData1, referer, proxyAddress, Convert.ToInt32(proxyPort), proxyUsername, proxyPassword);
                        }
                        catch (Exception ex)
                        { }
                       
                        try
                        {
                            AfterLoginPageSource = globusHttpHelper.getHtmlfromUrlProxy(new Uri("https://www.pinterest.com"), proxyAddress, Convert.ToInt32(proxyPort), proxyUsername, proxyPassword);
                        }
                        catch (Exception ex)
                        { }
                        if (AfterLoginPageSource.Contains("Logout") || AfterLoginPageSource.Contains("pinHolder") || AfterLoginPageSource.Contains("header1\": \"What are you interested in?") || AfterLoginPageSource.Contains("\"error\": null") || login.Contains("\"error\": null"))
                        {
                           // GlobusLogHelper.log.Info(" => [ Successfully Login for " + Username + " ]");
                            objPinUser.globusHttpHelper = globusHttpHelper;
                            this.LoggedIn = true;
                            objPinUser.isloggedin = true;
                            objPinUser.LoginStatus = "Success";

                        }
                        else
                        {
                            //GlobusLogHelper.log.Info(" => [ Login Failed for " + Username + " ]");
                            this.LoggedIn = false;
                            objPinUser.LoginStatus = "Fail";
                            try
                            {
                                try
                                {
                                    QueryExecuter.updatetb_emails("", "", "", "", objPinUser.ScreenName, Username, objPinUser.LoginStatus);
                                }
                                catch
                                {
                                }
                                //objUploadAccount.AccounLoad();
                                objDelegateAccountLoad();
                            }
                            catch { }
                            return false;
                        }
                    }
                    catch (Exception ex)
                    {
                        //GlobusLogHelper.log.Info(" => [ Login Failed for " + Username + " ]");
                        this.LoggedIn = false;
                        objPinUser.LoginStatus = "Fail";
                        try
                            {
                                try
                                {
                                    QueryExecuter.updatetb_emails("", "", "", "", objPinUser.ScreenName, Username, objPinUser.LoginStatus);
                                }
                                catch
                                {
                                }
                                //objUploadAccount.AccounLoad();
                                objDelegateAccountLoad();
                            }
                            catch { }
                       
                        return false;
                    }

                    try
                    {
                        List<string> listFollowersFromDatabse = new List<string>();
                        try
                        {
                            string screen_Name = Getscreen_Name(ref objPinUser);
                            objPinUser.ScreenName = screen_Name;
                            DataSet ds = QME.getFollower(screen_Name);

                            foreach (System.Data.DataRow dRow in ds.Tables[0].Rows)
                            {
                                try
                                {
                                    listFollowersFromDatabse.Add(dRow["FollwerName"].ToString());
                                }
                                catch { }

                            }
                        }
                        catch { }

                        try
                        {
                            #region old Commented Code
                            ///string screen_Name = Getscreen_Name(ref objPinUser);
                            ///Screen_Name = screen_Name;
                            //Get current followers list from website
                           // List<string> FollowersName = GetRefrshFollowerName(objPinUser.ScreenName, ref objPinUser);

                           // //FollowersName.RemoveAt(0);

                           // if (FollowersName != null)
                           // {
                           //     FollowersName = FollowersName.Distinct().ToList();
                           // }
                           // if (FollowersName.Contains(objPinUser.ScreenName))
                           // {
                           //     FollowersName.Remove(objPinUser.ScreenName);
                           // }
                           // //listFollowersFromDatabse.Add("gunde");
                           // List<string> listUnfollowers = listFollowersFromDatabse.Except(FollowersName).ToList();

                           //// GlobusLogHelper.log.Info(listUnfollowers.Count + " users Unfollowed Account : " + screen_Name);

                           // string UnfollowersList = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\PInterestUnfollowersList.csv";

                           // //write unfollowers list to csv
                           // if (!System.IO.File.Exists(UnfollowersList))                                                             //*     CSV Header     *//
                           // {
                           //     try
                           //     {
                           //         string dataFormat = "Account_ScreenName" + "," + "UnfollowerUsername";
                           //         GlobusFileHelper.AppendStringToTextfileNewLine(dataFormat, UnfollowersList); //dataFormat
                           //     }
                           //     catch (Exception ex) { };
                           // }

                           // foreach (string unfollower in listUnfollowers)
                           // {
                           //     try
                           //     {
                           //         string dataFormat = objPinUser.ScreenName + "," + unfollower;
                           //         GlobusFileHelper.AppendStringToTextfileNewLine(dataFormat, UnfollowersList); //dataFormat

                           //         //GlobusLogHelper.log.Info("Unfollower : " + unfollower + " for Account : " + screen_Name + " written to file " + UnfollowersList);
                           //     }
                           //     catch (Exception ex) { };

                           //     try
                           //     {
                           //         QueryExecuter.deleteFollower(objPinUser.ScreenName, unfollower);                                     
                           //         //GlobusLogHelper.log.Info("Unfollower : " + unfollower + " for Account : " + screen_Name + " deleted from Databse");
                           //     }
                           //     catch { }
                           // }

                           // List<string> listNewFollowers = FollowersName.Except(listFollowersFromDatabse).ToList();

                           //// GlobusLogHelper.log.Info(listNewFollowers.Count + " NEW Followers for Account : " + screen_Name + "");

                           // foreach (string follName_item in listNewFollowers)
                           // {
                           //     try
                           //     {
                           //         QueryExecuter.insertFollowerName(objPinUser.ScreenName, follName_item);   
                           //         //GlobusLogHelper.log.Info("New follower : " + follName_item + " for Account : " + screen_Name + " added to Databse");
                           //     }
                           //     catch { }

                            // }
                            #endregion

                            string follower = GetFollowercount(objPinUser.ScreenName, ref objPinUser);
                            string following = GetFollowingCount(objPinUser.ScreenName, ref objPinUser);
                            //string BOARDS = GetBoard(objPinUser.ScreenName, ref objPinUser);


                            //Globals.followingCountLogin = int.Parse(PinterestAccountManager.getBetween(following, "value'>", "</span>"));

                            string followingCount = following;
                            string BOARDS = string.Empty;
                            string BoardsName = string.Empty;
                            List<string> BOARDSNAMES = new List<string>();
                            List<string> lstBoardNamesNew = new List<string>();
                            if (inviteStart)
                            {
                                BOARDSNAMES = GetAllBoardNames_new1(objPinUser.ScreenName, ref objPinUser);

                                foreach (var itemBoardNames in BOARDSNAMES)
                                {
                                    lstBoardNamesNew.Add(itemBoardNames.ToLower().Replace(" ", "-"));
                                }
                                objPinUser.Boards = lstBoardNamesNew;
                            }
                            inviteStart = true;
                            

                            try
                            {
                                foreach (string item_BoardNames in BOARDSNAMES)
                                {                             
                                    BoardsName += item_BoardNames + (":").ToString();
                                }
                            }
                            catch { }

                            try
                            {
                                try
                                {

                                    QueryExecuter.updatetb_emails(follower, followingCount, BOARDS, BoardsName, objPinUser.ScreenName, Username, objPinUser.LoginStatus);
                                }
                                catch(Exception ex)
                                {
                                    GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
                                }
                                //objUploadAccount.AccounLoad();
                                objDelegateAccountLoad();

                            }
                            catch { }
                        }

                        catch { }

                        string[] ArrData = System.Text.RegularExpressions.Regex.Split(AfterLoginPageSource, "username");

                        foreach (var item in ArrData)
                        {
                            try
                            {
                                if (item.Contains("{\"page_info"))
                                {
                                    continue;
                                }
                                if (!item.StartsWith("\": null,") && !item.StartsWith("{\"request_identifier\""))
                                {
                                    int startindex = item.IndexOf(":");
                                    int endindex = item.IndexOf("\", \"");

                                    this.Name = item.Substring(startindex + 1, endindex - startindex).Replace("id=\"UserNav\"", string.Empty).Replace("a ", string.Empty).Replace("<", string.Empty).Replace(">", string.Empty).Replace("'", string.Empty).Replace("href=", string.Empty).Replace("\"", string.Empty).Replace("/", string.Empty).Trim();
                                    break;
                                }
                                if (item.Contains("locale"))// && item.Contains("P.currentUser.set"))
                                {
                                    int startindex = item.IndexOf(":");
                                    int endindex = item.IndexOf("\", \"");

                                    this.Name = item.Substring(startindex + 1, endindex - startindex).Replace("id=\"UserNav\"", string.Empty).Replace("a ", string.Empty).Replace("<", string.Empty).Replace(">", string.Empty).Replace("'", string.Empty).Replace("href=", string.Empty).Replace("\"", string.Empty).Replace("/", string.Empty).Trim();
                                    break;
                                }
                                else if (item.Contains("name\": \"AuthHomePage"))
                                {
                                    int startindex = item.IndexOf(":");
                                    int endindex = item.IndexOf("\", \"");

                                    this.Name = item.Substring(startindex + 1, endindex - startindex).Replace("\"", string.Empty).Trim();
                                }
                            }
                            catch (Exception ex)
                            { }
                        }
                        try
                        {
                            if (ArrData.Count() == 2 && string.IsNullOrEmpty(Name))
                            {
                                int startindex = ArrData[1].IndexOf(":");
                                int endindex = ArrData[1].IndexOf("\", \"");

                                this.Name = ArrData[1].Substring(startindex + 1, endindex - startindex).Replace("id=\"UserNav\"", string.Empty).Replace("a ", string.Empty).Replace("<", string.Empty).Replace(">", string.Empty).Replace("'", string.Empty).Replace("href=", string.Empty).Replace("\"", string.Empty).Replace("/", string.Empty).Trim();
                            }
                        }
                        catch (Exception ex)
                        { }
                    }
                    catch (Exception ex)
                    {
                        this.Name = string.Empty;
                    }
                }
                if (this.LoggedIn)
                {
                    return true;
                }
            }
            catch (Exception ex)
            { }
            return false;
        }
コード例 #29
0
ファイル: AccountManager.cs プロジェクト: shah8701/faceboard
        private void FinishRegistration(string responseRegistration, string email, string password, string proxyAddress, string proxyPort, string proxyUser, string proxyPassword, ref string DOB, ref GlobusHttpHelper HttpHelper)
        {
            try
            {
                #region MyRegion
                // Code For [email protected]
                //if (email.Contains("+") || email.Contains("%2B"))
                //{
                //    try
                //    {
                //        string replacePart = email.Substring(email.IndexOf("+"), (email.IndexOf("@", email.IndexOf("+")) - email.IndexOf("+"))).Replace("+", string.Empty);
                //        email = email.Replace("+", string.Empty).Replace("%2B", string.Empty).Replace(replacePart, string.Empty);
                //    }
                //    catch
                //    {
                //    }
                //}

                //string registration_succeeded = "";
                //string alredy_exist = ""; 
                #endregion

                string registrationstatus = "";
                if (!string.IsNullOrEmpty(responseRegistration) && responseRegistration.Contains("registration_succeeded"))
                {
                    //AddToListBox("Registration Succeeded With User Name : " + email);
                    try
                    {
                        string res = HttpHelper.getHtmlfromUrlProxy(new Uri("http://www.facebook.com/c.php?email=" + email), proxyAddress, Convert.ToInt32(proxyPort), proxyUser, proxyPassword);

                        registrationstatus = "registration_succeeded";

                        if (!string.IsNullOrEmpty(email))
                        {
                            // GlobusFileHelper.AppendStringToTextfileNewLine(email + ":" + password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUser + ":" + proxyPassword + "<>" + DOB, Path.Combine(Globals.FD_DesktopPath, "CreatedAccountsPlusType.txt"));
                        }
                    }
                    catch(Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }

                    VerifiyAccount(email, password, proxyAddress, proxyPort, proxyUser, proxyPassword, DOB, ref HttpHelper, registrationstatus);
                }
                //else if (!string.IsNullOrEmpty(responseRegistration) && responseRegistration.Contains("It looks like you already have an account on Facebook"))
                else if (responseRegistration.Contains("It looks like you already have an account on Facebook"))
                {
                    //AddToListBox("It looks like you already have an account on Facebook");
                    try
                    {
                        string res = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.AccountVerificationPhpEmail + email));       //"http://www.facebook.com/c.php?email="                     
                        registrationstatus = "alredy_exist";
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error(ex.StackTrace);
                    }

                    VerifiyAccount(email, password, proxyAddress, proxyPort, proxyUser, proxyPassword, DOB, ref HttpHelper, registrationstatus);
                }

            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(ex.StackTrace);
            }
        }