Exemple #1
0
        private void StartScarppLoginUsingInputData(object Parameter)
        {
            try
            {
                if (!IsStopScrapper)
                {
                    lstScrapperStopThread.Add(Thread.CurrentThread);
                    lstScrapperStopThread.Distinct();
                    Thread.CurrentThread.IsBackground = true;
                }
                try
                {
                    InBoardPro.StartLinkedinScrapping.lstNumberOfThreads = lstScrapperStopThread;
                }
                catch { }

                string account     = string.Empty;
                string post        = string.Empty;
                Array  paramsArray = new object[1];

                paramsArray = (Array)Parameter;

                KeyValuePair <string, LinkedInMaster> item = (KeyValuePair <string, LinkedInMaster>)paramsArray.GetValue(0);
                account = item.Key;

                try
                {
                    account = account.Split(':')[0];
                }
                catch { }

                GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
                LinkedinLogin    Login      = new LinkedinLogin();


                Login.accountUser   = account;
                Login.accountPass   = item.Value._Password;
                Login.proxyAddress  = item.Value._ProxyAddress;
                Login.proxyPort     = item.Value._ProxyPort;
                Login.proxyUserName = item.Value._ProxyUsername;
                Login.proxyPassword = item.Value._ProxyPassword;
                Login.Postalcode    = item.Value._Postalcode;
                Login.Distance      = item.Value._Distance;
                Login.IndustryType  = item.Value._IndustryType;
                Login.LastName      = item.Value._LastName;

                InBoardPro.StartLinkedinScrapping objstartscrapp = new InBoardPro.StartLinkedinScrapping();
                objstartscrapp.InBoardProGetDataLogEvents.addToLogger += ScrapperLogEvents_addToLogger;
                Login.logger.addToLogger += new EventHandler(ScrapperLogEvents_addToLogger);

                if (!Login.IsLoggedIn)
                {
                    try
                    {
                        Login.LoginHttpHelper(ref HttpHelper);
                    }
                    catch { }
                }
                try
                {
                    if (Login.IsLoggedIn)
                    {
                        objstartscrapp.ParsingOfInBoardProGetData(ref HttpHelper, Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword, Login.Postalcode, Login.Distance, Login.IndustryType, Login.LastName);
                    }
                }
                catch { }
                objstartscrapp.InBoardProGetDataLogEvents.addToLogger -= ScrapperLogEvents_addToLogger;
                Login.logger.addToLogger -= new EventHandler(ScrapperLogEvents_addToLogger);
            }
            catch { }
        }
        private void StartScarppLoginUsingInputData(object Parameter)
        {
            try
            {
                if (!IsStopScrapper)
                {
                    lstScrapperStopThread.Add(Thread.CurrentThread);
                    lstScrapperStopThread.Distinct();
                    Thread.CurrentThread.IsBackground = true;
                }
                try
                {
                    InBoardPro.StartLinkedinScrapping.lstNumberOfThreads = lstScrapperStopThread;
                }
                catch { }

                string account = string.Empty;
                string post = string.Empty;
                Array paramsArray = new object[1];

                paramsArray = (Array)Parameter;

                KeyValuePair<string, LinkedInMaster> item = (KeyValuePair<string, LinkedInMaster>)paramsArray.GetValue(0);
                account = item.Key;
                GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
                LinkedinLogin Login = new LinkedinLogin();

                Login.accountUser = item.Key;
                Login.accountPass = item.Value._Password;
                Login.proxyAddress = item.Value._ProxyAddress;
                Login.proxyPort = item.Value._ProxyPort;
                Login.proxyUserName = item.Value._ProxyUsername;
                Login.proxyPassword = item.Value._ProxyPassword;
                Login.Postalcode = item.Value._Postalcode;
                Login.Distance = item.Value._Distance;
                Login.IndustryType = item.Value._IndustryType;
                Login.LastName = item.Value._LastName;
                // StatusUpdate.StatusUpdate obj_StatusUpdate = new StatusUpdate.StatusUpdate(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword);
                // InBoardProGetData.StartLinkedinScrapping objstartscrapp = new InBoardProGetData.StartLinkedinScrapping(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword, Login.Postalcode, Login.Distance, Login.IndustryType, Login.LastName);
                //  InBoardProGetData.LinkinScrappRecord obj_Scrapper = new InBoardProGetData.LinkinScrappRecord(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword, Login.Postalcode, Login.Distance, Login.IndustryType, Login.LastName);
                //Login.logger.addToLogger += new EventHandler(logger_StatusUpdateaddToLogger);
                //obj_StatusUpdate.logger.addToLogger += new EventHandler(logger_StatusUpdateaddToLogger);
                // StatusUpdate.StatusUpdate obj_StatusUpdate = new StatusUpdate.StatusUpdate(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword);
                InBoardPro.StartLinkedinScrapping objstartscrapp = new InBoardPro.StartLinkedinScrapping();
                objstartscrapp.InBoardProGetDataLogEvents.addToLogger += ScrapperLogEvents_addToLogger;
                Login.logger.addToLogger += new EventHandler(ScrapperLogEvents_addToLogger);

                if (!Login.IsLoggedIn)
                {
                    try
                    {
                        Login.LoginHttpHelper(ref HttpHelper);
                    }
                    catch { }
                }
                try
                {
                    if (Login.IsLoggedIn)
                    {
                        objstartscrapp.ParsingOfInBoardProGetData(ref HttpHelper, Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword, Login.Postalcode, Login.Distance, Login.IndustryType, Login.LastName);
                    }
                }
                catch { }
                objstartscrapp.InBoardProGetDataLogEvents.addToLogger -= ScrapperLogEvents_addToLogger;
                Login.logger.addToLogger -= new EventHandler(ScrapperLogEvents_addToLogger);
            }
            catch { }
        }