public void StartInBoardProGetData(string args) { try { string[] ParameterData_Split = Regex.Split(args, ":"); string Account = ParameterData_Split[0]; string password = ParameterData_Split[1]; string ProxyAddress = ParameterData_Split[2]; string ProxyPort = ParameterData_Split[3]; string ProxyUserName = ParameterData_Split[4]; string ProxyPassword = ParameterData_Split[5]; string FirstName = ParameterData_Split[7]; string LastName = ParameterData_Split[8]; string Location = ParameterData_Split[9]; string Country = ParameterData_Split[10]; string LocationArea = ParameterData_Split[11]; string PostalCode = ParameterData_Split[12]; string Company = ParameterData_Split[13]; string Keyword = ParameterData_Split[14]; string Title = ParameterData_Split[15]; string IndustryType = ParameterData_Split[16]; string Relationship = ParameterData_Split[17]; string language = ParameterData_Split[18]; string Groups = ParameterData_Split[19]; string FileName = ParameterData_Split[20]; string TitleValue = ParameterData_Split[21]; string CompanyValue = ParameterData_Split[22]; string within = ParameterData_Split[23]; string YearsOfExperience = ParameterData_Split[24]; string Function = ParameterData_Split[25]; string SeniorLevel = ParameterData_Split[26]; string IntrestedIn = ParameterData_Split[27]; string CompanySize = ParameterData_Split[28]; string Fortune1000 = ParameterData_Split[29]; string RecentlyJoined = ParameterData_Split[30]; GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); LinkedInScrape objlinkscr = new LinkedInScrape(); LinkedInMaster objLinkedInMaster = new LinkedInMaster(); AddToLogger("[ " + DateTime.Now + " ] => [ Logging with Account : " + Account + " ]"); objLinkedInMaster.LoginHttpHelperForCampaignScraper(ref HttpHelper, Account, password, ProxyAddress, ProxyPort, ProxyUserName, ProxyPassword); if (objLinkedInMaster.IsLoggedIn) { AddToLogger("[ " + DateTime.Now + " ] => [ Logged in with Account : " + Account + " ]"); AddToLogger("[ " + DateTime.Now + " ] => [ Start LinkedIn Crawling ]"); StartCampaignInBoardProGetDataWithPagination(ref HttpHelper, Account, FirstName, LastName, Location, Country, LocationArea, PostalCode, Company, Keyword, Title, IndustryType, Relationship, language, Groups, FileName, TitleValue, CompanyValue, within, YearsOfExperience, Function, SeniorLevel, IntrestedIn, CompanySize, Fortune1000, RecentlyJoined); } } catch (Exception ex) { Console.WriteLine("Error >>> " + ex.StackTrace); } finally { } }
private bool Login_InBoardProGetDataForCampaignScraper(ref GlobusHttpHelper HttpHelper, string Account, string password, string ProxyAddress, string ProxyPort, string ProxyUserName, string ProxyPassword) { //Thread.Sleep(1 * 60 * 1000); bool isLoggedin = false; try { //this.Invoke(new MethodInvoker(delegate //{ try { if (!this.IsHandleCreated) { string abc = "handle not created"; } this.Invoke(new MethodInvoker(delegate { AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ Process Running Please wait for sometimes... ]"); })); if (SearchCriteria.SignIN) { LinkedinLogin Login = new LinkedinLogin(); //For Sign Out Login.LogoutHttpHelper(); SearchCriteria.SignOut = true; } if (SearchCriteria.SignOut) { SearchCriteria.LoginID = string.Empty; // if (LinkedInManager.linkedInDictionary.Count() > 0) // { try { object temp = null; // comboBoxemail.Invoke(new MethodInvoker(delegate // { // temp = comboBoxemail.SelectedItem; // })); // if (temp != null) // { //GlobusHttpHelper httpHelper = new GlobusHttpHelper(); string acc = ""; //comboBoxemail.Invoke(new MethodInvoker(delegate // { // acc = comboBoxemail.SelectedItem.ToString(); // SearchCriteria.LoginID = comboBoxemail.SelectedItem.ToString();//change 21/08/12 // })); //string acc = account.Remove(account.IndexOf(':')); //Run a separate thread for each account SearchCriteria.LoginID = Account; //LinkedInMaster item = null; LinkedInMaster item = new LinkedInMaster(); //LinkedInManager.linkedInDictionary.TryGetValue(acc, out item); //item.logger.addToLogger += ScrapeEvent_addToLogger; item.LoginHttpHelperForCampaignScraper(ref HttpHelper, Account, password, ProxyAddress, ProxyPort, ProxyUserName, ProxyPassword); if (item.IsLoggedIn) { AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ Logged in With Account : " + Account + " ]"); isLoggedin = true; } if (SearchCriteria.loginREsponce.Contains("Your LinkedIn account has been temporarily restricted")) { AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ " + SearchCriteria.LoginID + "Your LinkedIn account has been temporarily restricted ]"); } if (SearchCriteria.loginREsponce.Contains("Please confirm your email address")) { AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ " + SearchCriteria.LoginID + " account has been temporarily restricted Please confirm your email address ]"); } if (!item.IsLoggedIn) { AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ Couldn't Login With : " + Account + " ]"); } SearchCriteria.SignIN = true; SearchCriteria.SignOut = false; try { this.Invoke(new MethodInvoker(delegate { //LoadCmboData(); })); } catch { } // } } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> comboBoxemail_SelectedIndexChanged() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> comboBoxemail_SelectedIndexChanged() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinPreScrapperErrorLogs); } // } } } catch { } //})); //DisableEnableScrapperControls(); } catch { } return isLoggedin; }