Example #1
0
        private void CheckAccounts()
        {
            foreach (string item in AccountChecker.AccountChecker.lst_Usernames)
            {
                try
                {
                    string stats;

                    AccountChecker.AccountChecker accountChecker = new AccountChecker.AccountChecker();

                    string username = item.Split(':')[0];

                    if (accountChecker.IsUserAlive(username, out stats))
                    {
                        AddToLog_Checker("Account : " + item + " Exists");
                        Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(item, Globals.path_ExistingIDs);
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(stats))
                        {
                            if (stats == "doesn’t exist" || stats == "404")
                            {
                                AddToLog_Checker("Account : " + item + " does Not Exist");
                                Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(item, Globals.path_NonExistingIDs);
                            }
                            if (stats == "suspended")
                            {
                                AddToLog_Checker("Account : " + item + " does Not Exist");
                                Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(item, Globals.path_SuspendedIDs);
                            } 
                        }
                        else
                        {
                            AddToLog_Checker("Couldn't check : " + item + "");
                        }
                    }
                }
                catch (Exception ex)
                {
                    AddToLog_Checker(ex.Message);
                }
            }

        }
Example #2
0
        private void CheckAccounts()
        {
            foreach (string item in AccountChecker.AccountChecker.lst_Usernames)
            {
                try
                {
                    string stats;

                    AccountChecker.AccountChecker accountChecker = new AccountChecker.AccountChecker();

                    string username = item.Split(':')[0];

                    if (accountChecker.IsUserAlive(username, out stats))
                    {
                        AddToLog_Checker("Account : " + item + " Exists");
                        Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(item, Globals.path_ExistingIDs);
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(stats))
                        {
                            if (stats == "doesn’t exist" || stats == "404" || stats == "Not exsist")
                            {
                                AddToLog_Checker("Account : " + item + " does Not Exist");
                                Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(item, Globals.path_NonExistingIDs);
                            }
                            if (stats == "suspended")
                            {
                                AddToLog_Checker("Account : " + item + " Suspended");
                                Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(item, Globals.path_SuspendedIDs);
                            }
                            if (stats == "Rate limit exceeded")
                            {
                                AddToLog_Checker("Account : " + item + " Rate limit exceeded");
                                 AddToLog_Checker("Rate Limit Exceeded");
                                 AddToLog_Checker("Please Try After Some Time");
                            }
                        }
                        else
                        {
                            AddToLog_Checker("Couldn't check : " + item + "");
                        }
                    }
                }
                catch (Exception ex)
                {
                    AddToLog_Checker(ex.Message);
                    GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> CheckAccounts() --> " + ex.Message, Globals.Path_AccountCheckerErroLog);
                    GlobusFileHelper.AppendStringToTextfileNewLine("Error --> CheckAccounts() --> " + ex.Message, Globals.Path_TwtErrorLogs);
                }
            }

        }
Example #3
0
        public void StartUsernamechecker(object parameters)
        {
            try
            {
                accountCheckerThreadStart = true;
                Lst_accountCheckerThread.Add(Thread.CurrentThread);
                Lst_accountCheckerThread = Lst_accountCheckerThread.Distinct().ToList();
                Thread.CurrentThread.IsBackground = true;
            }
            catch (Exception)
            {
            }

            try
            {
                Interlocked.Increment(ref countCheckAccount);
                Array paramsArray = new object[2];

                paramsArray = (Array)parameters;

                //List<string> lstItem = (List<string>)paramsArray.GetValue(0);
                string item = (string)paramsArray.GetValue(0);
                //foreach (string item in lstItem)
                {
                    try
                    {
                        //Check all special carector which is not supported in twiter
                        if (!item.Contains(":"))
                        {
                            //Regex objNotNaturalPattern = new Regex(@"[^\w\*]");
                            Regex objNotNaturalPattern = new Regex(@"/@(\w+)/");
                            if (objNotNaturalPattern.IsMatch(item))
                            {
                                AddToLog_Checker("[ " + DateTime.Now + " ] => [ User name is not Correct : " + item + " ]");
                                //continue;
                                return;
                            }
                        }

                        string stats;

                        AccountChecker.AccountChecker accountChecker = new AccountChecker.AccountChecker();

                        string username = item.Split(':')[0];

                        if (accountChecker.IsUserAlive(username, out stats))
                        {
                            AddToLog_Checker("[ " + DateTime.Now + " ] => [ Account : " + username + " Exists ]");
                            Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(item, Globals.path_ExistingIDs);
                        }
                        else
                        {
                            if (!string.IsNullOrEmpty(stats))
                            {
                                if (stats == "doesn’t exist" || stats == "404" || stats == "403" || stats == "Not exsist")
                                {
                                    AddToLog_Checker("[ " + DateTime.Now + " ] => [ Account : " + item + " does Not Exist ]");
                                    Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(item, Globals.path_NonExistingIDs);
                                }
                                if (stats == "suspended")
                                {
                                    AddToLog_Checker("[ " + DateTime.Now + " ] => [ Account : " + item + " Suspended ]");
                                    Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(item, Globals.path_SuspendedIDs);
                                }
                                if (stats == "Rate limit exceeded")
                                {
                                    AddToLog_Checker("[ " + DateTime.Now + " ] => [ Account : " + item + " Rate limit exceeded ]");
                                    AddToLog_Checker("[ " + DateTime.Now + " ] => [ Rate Limit Exceeded ]");
                                    AddToLog_Checker("[ " + DateTime.Now + " ] => [ Please Try After Some Time ]");
                                }
                            }
                            else
                            {
                                AddToLog_Checker("[ " + DateTime.Now + " ] => [ Couldn't check : " + item + " ]");
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        //AddToLog_Checker("[ " + DateTime.Now + " ] => [ " + ex.Message + " ]");
                        GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> CheckAccounts() --> " + ex.Message, Globals.Path_AccountCheckerErroLog);
                        GlobusFileHelper.AppendStringToTextfileNewLine("Error --> CheckAccounts() --> " + ex.Message, Globals.Path_TwtErrorLogs);
                    }
                }
            }
            catch (Exception)
            {

            }
            finally
            {
                lock (lockerCheckAccount)
                {
                    Monitor.Pulse(lockerCheckAccount);
                }

                Interlocked.Decrement(ref countCheckAccount);

                counterCheckAccount--;
                if (counterCheckAccount == 0)
                {
                    AddToLog_Checker("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                }
            }
        }