コード例 #1
0
        private void Star_ScrapTweetAndReplyMultithreaded(object parameters)
        {
            try
            {
                Array paramsArray = new object[2];

                paramsArray = (Array)parameters;

                KeyValuePair <string, TweetAccountManager> keyValue = (KeyValuePair <string, TweetAccountManager>)paramsArray.GetValue(0);


                List <string> list_userIDsToFollow = new List <string>();//(List<string>)paramsArray.GetValue(1);

                TweetAccountManager tweetAccountManager = keyValue.Value;

                //tweetAccountManager.unFollower.logEvents.addToLogger += new EventHandler(logEvents_UnFollower_addToLogger);
                tweetAccountManager.logEvents.addToLogger += new EventHandler(ReplyInterface_AddToLogger);

                if (!tweetAccountManager.IsLoggedIn)
                {
                    tweetAccountManager.Login();
                }

                if (tweetAccountManager.AccountStatus == "Account Suspended")
                {
                    clsDBQueryManager database = new clsDBQueryManager();
                    database.UpdateSuspendedAcc(tweetAccountManager.Username);

                    AddToReplyInterfaceLog("[ " + DateTime.Now + " ] => [ Account Suspended With User Name : " + tweetAccountManager.Username + " ]");
                    return;
                }

                tweetAccountManager.Mention_ScrapTweetAndReply();

                BindData();

                tweetAccountManager.logEvents.addToLogger -= ReplyInterface_AddToLogger;
            }
            catch
            {
            }
        }
コード例 #2
0
        private void StartUnFollowingMultithreaded(object parameters)
        {
            try
            {
                if (IsStopFollowYourFollowers)
                {
                    return;
                }

                // if (!IsStopFollowYourFollowers)
                {
                    lstIsStopFollowYourFollowers.Add(Thread.CurrentThread);
                    lstIsStopFollowYourFollowers.Distinct();
                    Thread.CurrentThread.IsBackground = true;
                }

                Array paramsArray = new object[2];

                paramsArray = (Array)parameters;
                int NoOfFollwos = 0;
                KeyValuePair <string, TweetAccountManager> keyValue = (KeyValuePair <string, TweetAccountManager>)paramsArray.GetValue(0);
                string NofUnfollows = (string)paramsArray.GetValue(1);
                if (!string.IsNullOrEmpty(NofUnfollows) && NumberHelper.ValidateNumber(NofUnfollows))
                {
                    NoOfFollwos = Int32.Parse(NofUnfollows);
                }
                bool OtherUser = false;
                frmMain_NewUI.IsFollowerScreenName = true;
                List <string> list_userIDsToFollow = new List <string>();

                TweetAccountManager tweetAccountManager = keyValue.Value;
                AddToLog_follow("[ " + DateTime.Now + " ] => [following Process Started For Account : " + keyValue.Key + " ]");
                //Add to Threads Dictionary
                //AddThreadToDictionary(strModule(Module.Follow), tweetAccountManager.Username);
                tweetAccountManager.unFollower.logEvents.addToLogger += new EventHandler(logEvents_Follower_addToLogger);
                tweetAccountManager.logEvents.addToLogger            += logEvents_Follower_addToLogger;
                if (!tweetAccountManager.IsLoggedIn)
                {
                    tweetAccountManager.Login();
                }

                if (!tweetAccountManager.IsLoggedIn)
                {
                    AddToLog_follow("[ " + DateTime.Now + " ] => [ Not Logged In With Account : " + keyValue.Key + " ]");
                    return;
                }
                //////////////temp mehtod
                {
                }
                //AddToLog_Unfollow("Checking for Persons Not Followed Back");

                Thread thread_UnFollowing = null;

                //Check Test box and anf useing feature box is checked
                TwitterDataScrapper objTwitterDataScrapper = new TwitterDataScrapper();
                //if (rdoFollowYourFollowers.Checked)

                //thread_UnFollowing = new Thread(() =>
                //{
                //    list_userIDsToFollow = tweetAccountManager.GetFollowYourFollowersList();

                //});

                list_userIDsToFollow = tweetAccountManager.GetFollowYourFollowersList();

                if (GlobusRegex.ValidateNumber(txtfollowMinDelay.Text))
                {
                    followMinDelay = Convert.ToInt32(txtfollowMinDelay.Text);
                }
                if (GlobusRegex.ValidateNumber(txtfollowMaxDelay.Text))
                {
                    followMaxDelay = Convert.ToInt32(txtfollowMaxDelay.Text);
                }
                if (list_userIDsToFollow.Count > 0)
                {
                    tweetAccountManager.FollowUsingURLs(list_userIDsToFollow, followMinDelay, followMaxDelay, OtherUser);
                }
                else
                {
                    AddToLog_follow("[ " + DateTime.Now + " ] => [ No user id is available for Account : " + keyValue.Key + " ]");
                }

                tweetAccountManager.unFollower.logEvents.addToLogger -= logEvents_Follower_addToLogger;
                tweetAccountManager.logEvents.addToLogger            -= logEvents_Follower_addToLogger;
            }
            catch (Exception ex)
            {
                ErrorLogger.AddToErrorLogText(ex.Message);
                GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> StartUnFollowingMultithreaded()  --> " + ex.Message, Globals.Path_UnfollowerErroLog);
                GlobusFileHelper.AppendStringToTextfileNewLine("Error --> StartUnFollowingMultithreaded() --> " + ex.Message, Globals.Path_TwtErrorLogs);
            }

            finally
            {
                counter_Account--;
                if (counter_Account == 0)
                {
                    if (btnStartFollow.InvokeRequired)
                    {
                        btnStartFollow.Invoke(new MethodInvoker(delegate
                        {
                            AddToLog_follow("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                            AddToLog_follow("---------------------------------------------------------------------------------------------------------------------------");
                            btnStartFollow.Cursor = Cursors.Default;
                        }));
                    }
                }
            }
        }
コード例 #3
0
        private void ScrapeMemberSeacrh()
        {
            try
            {
                lstIsStopScrapMember.Add(Thread.CurrentThread);
                lstIsStopScrapMember.Distinct();
                Thread.CurrentThread.IsBackground = true;
            }
            catch { }

            try
            {
                TwitterDataScrapper TweetData        = new TwitterDataScrapper();
                GlobusHttpHelper    globusHttpHelper = new GlobusHttpHelper();
                int counter = 0;
                TweetAccountManager TweetLogin = new TweetAccountManager();


                txtlimitScrapeUsers.Invoke(new MethodInvoker(delegate
                {
                    if (!string.IsNullOrEmpty(txtlimitScrapeUsers.Text.Trim()) && NumberHelper.ValidateNumber(txtlimitScrapeUsers.Text.Trim()))
                    {
                        noOfRecords = Convert.ToInt32(txtlimitScrapeUsers.Text.Trim());
                        if (noOfRecords == 0)
                        {
                            AddToLog_ScrapMember("[ " + DateTime.Now + " ] => [ Do not put Zero value ]");
                            AddToLog_ScrapMember("[ " + DateTime.Now + " ] => [ Default number of records is 50 ]");
                            noOfRecords = 50;
                        }
                    }
                    else
                    {
                        AddToLog_ScrapMember("[ " + DateTime.Now + " ] => [ please enter value in number of users ]");
                        return;
                    }
                }));


                foreach (KeyValuePair <string, TweetAccountManager> item in TweetAccountContainer.dictionary_TweetAccount)
                {
                    AddToLog_ScrapMember("[ " + DateTime.Now + " ] => [ Login process starting]");
                    if (counter > TweetAccountContainer.dictionary_TweetAccount.Count)
                    {
                        counter = 0;
                    }

                    TweetLogin            = new TweetAccountManager();
                    TweetLogin.Username   = item.Key;
                    TweetLogin.Password   = item.Value.Password;
                    TweetLogin.IPAddress  = item.Value.IPAddress;
                    TweetLogin.IPPort     = item.Value.IPPort;
                    TweetLogin.IPUsername = item.Value.IPUsername;
                    TweetLogin.IPpassword = item.Value.IPpassword;
                    TweetLogin.Login();

                    if (!TweetLogin.IsLoggedIn)
                    {
                        continue;
                    }
                    else
                    {
                        AddToLog_ScrapMember("[ " + DateTime.Now + " ] => [ Login process successful]");
                        globusHttpHelper = TweetLogin.globusHttpHelper;
                        counter++;
                        break;
                    }
                }


                if (!TweetLogin.IsLoggedIn)
                {
                    AddToLog_ScrapMember("[ " + DateTime.Now + " ] => [ Please Upload Atleast One Working Account To Get Details ]");
                    return;
                }


                AddToLog_ScrapMember("[ " + DateTime.Now + " ] => [ Scraping User ]");


                foreach (string item in lstUrl)
                {
                    string tempItem = string.Empty;
                    if (!item.Contains("https://twitter.com"))
                    {
                        tempItem = "https://twitter.com" + item;
                    }
                    else
                    {
                        tempItem = item;
                    }

                    List <string> lstMember    = new List <string>();
                    string        returnStatus = string.Empty;
                    getTweetUsers(item, ref globusHttpHelper);
                    //lstMember = GetMembers(item, ref globusHttpHelper, out returnStatus);
                    AddToLog_ScrapMember("[ " + DateTime.Now + " ] => [ Scraped Member for Url " + item + "]");
                }
            }
            catch { }
        }
コード例 #4
0
        public void StartResendEmailForVerification(object parameters)
        {
            try
            {
                lstEmailVarificationThread.Add(Thread.CurrentThread);
                lstEmailVarificationThread.Distinct().ToList();
                Thread.CurrentThread.IsBackground = true;

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

                string Email              = string.Empty;
                string Password           = string.Empty;
                string username           = string.Empty;
                string IPAddress          = string.Empty;
                string IPPort             = string.Empty;
                string IPUsername         = string.Empty;
                string IPpassword         = string.Empty;
                string IP                 = string.Empty;
                string tempEmail          = string.Empty;
                string postdataPageSource = string.Empty;

                counter = Lst_NonVerifiedEmailAccount.Count();
                string item = paramsArray.GetValue(0).ToString();


                try
                {
                    string[] arrItem = Regex.Split(item, ":");
                    tempEmail = arrItem[0];
                    if (arrItem.Length == 2)
                    {
                        Email    = arrItem[0]; //item.Key;
                        Password = arrItem[1]; //item.Value._Password;
                    }
                    else if (arrItem.Length == 4)
                    {
                        Email     = arrItem[0]; //item.Key;
                        Password  = arrItem[1]; //item.Value._Password;
                        IPAddress = arrItem[2]; //item.Value._IPAddress;
                        IPPort    = arrItem[3];
                    }
                    else if (arrItem.Length == 6)
                    {
                        Email      = arrItem[0]; //item.Key;
                        Password   = arrItem[1]; //item.Value._Password;
                        IPAddress  = arrItem[2]; //item.Value._IPAddress;
                        IPPort     = arrItem[3]; //item.Value._IPPort;
                        IPUsername = arrItem[4]; //item.Value._IPUsername;
                        IPpassword = arrItem[5]; //item.Value._IPpassword;
                    }
                    else
                    {
                        AddToEmailVerificationLog("[ " + DateTime.Now + " ] => [ Wrong Format For Email Password ]");
                        return;
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error >>> " + ex.StackTrace);
                }


                Globussoft.GlobusHttpHelper globusHelper   = new Globussoft.GlobusHttpHelper();
                TweetAccountManager         Accountmanager = new TweetAccountManager();

                Accountmanager.logEvents.addToLogger += new EventHandler(logEvents_addToLogger);

                ClsEmailActivator EmailActivate = new ClsEmailActivator();

                try
                {
                    Accountmanager.globusHttpHelper = globusHelper;
                    Accountmanager.Username         = Email.Replace(" ", "").Replace("\0", "");
                    Accountmanager.Password         = Password;
                    Accountmanager.IPAddress        = IPAddress;
                    Accountmanager.IPPort           = IPPort;
                    Accountmanager.IPUsername       = IPUsername;
                    Accountmanager.IPpassword       = IPpassword;
                    Accountmanager.Login();

                    if (Accountmanager.IsLoggedIn)
                    {
                        string postData = ("authenticity_token=" + Accountmanager.postAuthenticityToken).Trim();
                        postdataPageSource = Accountmanager.globusHttpHelper.postFormData(new Uri("https://twitter.com/account/resend_confirmation_email"), postData, "	https://twitter.com/", "", "", "", "");
                    }
                }
                catch { };


                if (postdataPageSource.Contains("A confirmation email has been sent to you."))
                {
                    AddToEmailVerificationLog("[ " + DateTime.Now + " ] => [ Email send to confirmation for Account : " + Email + " ]");
                }

                else
                {
                    Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password + ":" + username + ":" + IPAddress + ":" + IPPort + ":" + IPUsername + ":" + IPpassword, Globals.path_VerificationFailedAccounts);
                    AddToEmailVerificationLog("[ " + DateTime.Now + " ] => [ Email not send to confirmation for Account : " + Email + " ]");
                }
            }
            catch (Exception ex)
            {
                //AddToEmailVerificationLog("[ " + DateTime.Now + " ] => [ " + ex.Message + " ]");
            }
            finally
            {
                counter--;
                if (counter == 0)
                {
                    AddToEmailVerificationLog("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                    AddToEmailVerificationLog("------------------------------------------------------------------------------------------------------------------------------------------");
                }
            }
        }
コード例 #5
0
        public void StartVerification(object parameters)
        {
            try
            {
                lstEmailVarificationThread.Add(Thread.CurrentThread);
                lstEmailVarificationThread.Distinct().ToList();
                Thread.CurrentThread.IsBackground = true;

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

                string Email      = string.Empty;
                string Password   = string.Empty;
                string username   = string.Empty;
                string IPAddress  = string.Empty;
                string IPPort     = string.Empty;
                string IPUsername = string.Empty;
                string IPpassword = string.Empty;
                string IP         = string.Empty;
                string tempEmail  = string.Empty;


                #region commented by prabhat 07.12.13
                //string emailData = (string)paramsArray.GetValue(0);
                //if (paramsArray.Length>1)
                //{
                //    IP = (string)paramsArray.GetValue(1);
                //}

                //if (!emailData.Contains(':'))
                //{
                //    AddToEmailVerificationLog("[ " + DateTime.Now + " ] => [ Wrong Format Of Emails :- " + emailData + " ]");
                //    return;
                //}


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

                //AddToEmailVerificationLog("[ " + DateTime.Now + " ] => [ Going for Email Verification : " + Email + " ]");

                //if (!string.IsNullOrEmpty(IP))
                //{
                //    try
                //    {
                //        string[] IPData = IP.Split(':');
                //        if (IPData.Count() == 2)
                //        {
                //            IPAddress = IPData[0];
                //            IPPort = IPData[1];
                //        }
                //        if (IPData.Count() == 4)
                //        {
                //            IPAddress = IPData[0];
                //            IPPort = IPData[1];
                //            IPUsername = IPData[2];
                //            IPpassword = IPData[3];
                //        }
                //    }
                //    catch (Exception)
                //    {
                //    }
                //}
                #endregion

                counter = Lst_NonVerifiedEmailAccount.Count();
                string item = paramsArray.GetValue(0).ToString();


                try
                {
                    string[] arrItem = Regex.Split(item, ":");
                    tempEmail = arrItem[0];
                    if (arrItem.Length == 2)
                    {
                        Email    = arrItem[0]; //item.Key;
                        Password = arrItem[1]; //item.Value._Password;
                    }
                    else if (arrItem.Length == 4)
                    {
                        Email     = arrItem[0]; //item.Key;
                        Password  = arrItem[1]; //item.Value._Password;
                        IPAddress = arrItem[2]; //item.Value._IPAddress;
                        IPPort    = arrItem[3];
                    }
                    else if (arrItem.Length == 6)
                    {
                        Email      = arrItem[0]; //item.Key;
                        Password   = arrItem[1]; //item.Value._Password;
                        IPAddress  = arrItem[2]; //item.Value._IPAddress;
                        IPPort     = arrItem[3]; //item.Value._IPPort;
                        IPUsername = arrItem[4]; //item.Value._IPUsername;
                        IPpassword = arrItem[5]; //item.Value._IPpassword;
                    }
                    else
                    {
                        AddToEmailVerificationLog("[ " + DateTime.Now + " ] => [ Wrong Format For Email Password ]");
                        return;
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error >>> " + ex.StackTrace);
                }


                Globussoft.GlobusHttpHelper globusHelper   = new Globussoft.GlobusHttpHelper();
                TweetAccountManager         Accountmanager = new TweetAccountManager();

                Accountmanager.logEvents.addToLogger += new EventHandler(logEvents_addToLogger);

                ClsEmailActivator EmailActivate = new ClsEmailActivator();

                try
                {
                    Accountmanager.globusHttpHelper = globusHelper;
                    Accountmanager.Username         = Email.Replace(" ", "").Replace("\0", "");
                    Accountmanager.Password         = Password;
                    Accountmanager.IPAddress        = IPAddress;
                    Accountmanager.IPPort           = IPPort;
                    Accountmanager.IPUsername       = IPUsername;
                    Accountmanager.IPpassword       = IPpassword;
                    Accountmanager.Login();

                    if (Accountmanager.IsLoggedIn)
                    {
                        string postData           = ("authenticity_token=" + Accountmanager.postAuthenticityToken).Trim();
                        string postdataPageSource = Accountmanager.globusHttpHelper.postFormData(new Uri("https://twitter.com/account/resend_confirmation_email"), postData, "	https://twitter.com/", "", "", "", "");
                    }
                }
                catch { };


                bool verified = EmailActivate.EmailVerification(Email, Password, ref globusHelper);

                if (verified)
                {
                    try
                    {
                        string pageresponce = Accountmanager.globusHttpHelper.getHtmlfromUrl(new Uri("https://twitter.com/"), "", "");

                        //if (pageresponce.Contains("btn resend-confirmation-email-link"))
                        //{
                        //    verified = false;
                        //}
                    }
                    catch (Exception)
                    {
                        AddToEmailVerificationLog("[ " + DateTime.Now + " ] => [ Verified Account  login Failed  : " + Email + " ]");
                    }
                }
                if (verified && Accountmanager.IsLoggedIn)
                {
                    Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password + ":" + username + ":" + IPAddress + ":" + IPPort + ":" + IPUsername + ":" + IPpassword, Globals.path_SuccessfullyVerifiedAccounts);
                    AddToEmailVerificationLog("[ " + DateTime.Now + " ] => [ Account Verified : " + Email + " ]");
                }
                else
                {
                    Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + Password + ":" + username + ":" + IPAddress + ":" + IPPort + ":" + IPUsername + ":" + IPpassword, Globals.path_VerificationFailedAccounts);
                    AddToEmailVerificationLog("[ " + DateTime.Now + " ] => [ Account Couldn't be Email Verified : " + Email + " ]");
                }
            }
            catch (Exception ex)
            {
                //AddToEmailVerificationLog("[ " + DateTime.Now + " ] => [ " + ex.Message + " ]");
            }
            finally
            {
                counter--;
                if (counter == 0)
                {
                    AddToEmailVerificationLog("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                    AddToEmailVerificationLog("------------------------------------------------------------------------------------------------------------------------------------------");
                }
            }
        }
コード例 #6
0
        private void StartWebsiteLikeMultiThread(object parameters)
        {
            try
            {
                if (IsStopWebsiteLiker)
                {
                    return;
                }

                LstWebsiteLikeThread.Add(Thread.CurrentThread);
                LstWebsiteLikeThread = LstWebsiteLikeThread.Distinct().ToList();
                Thread.CurrentThread.IsBackground = true;
            }
            catch
            { };
            Array paramsArray = new object[2];

            paramsArray = (Array)parameters;
            int NumberOfWebsiteTobeLiked = 0;
            KeyValuePair <string, TweetAccountManager> keyValue = (KeyValuePair <string, TweetAccountManager>)paramsArray.GetValue(0);

            NumberOfWebsiteTobeLiked = (int)paramsArray.GetValue(1);


            bool OtherUser = false;
            TweetAccountManager tweetAccountManager = keyValue.Value;


            if (!tweetAccountManager.IsLoggedIn)
            {
                AddToWebsiteLikeLog("[ " + DateTime.Now + " ] => [ Logging With Account : " + keyValue.Key + " ]");
                tweetAccountManager.Login();
            }

            if (!tweetAccountManager.IsLoggedIn)
            {
                AddToWebsiteLikeLog("[ " + DateTime.Now + " ] => [ Not Logged In With Account : " + keyValue.Key + " ]");
                return;
            }

            AddToWebsiteLikeLog("[ " + DateTime.Now + " ] => [ Logged In With Account : " + keyValue.Key + " ]");
            foreach (string item in LstWebsiteLink)
            {
                string Pagesource      = string.Empty;
                string Response        = string.Empty;
                string Text            = string.Empty;
                string AuthencityToken = string.Empty;
                string tw_p            = string.Empty;
                string via             = string.Empty;
                string OrignalReferer  = string.Empty;
                try
                {
                    string Url = "https://about.twitter.com/resources/buttons#tweet";
                    Pagesource = tweetAccountManager.globusHttpHelper.getHtmlfromUrl(new Uri(Url), "", "");
                    Response   = tweetAccountManager.globusHttpHelper.getHtmlfromUrl(new Uri("https://twitter.com/intent/tweet?original_referer=https%3A%2F%2Fabout.twitter.com%2Fresources%2Fbuttons&text=Twitter%20Buttons%20%7C%20About&tw_p=tweetbutton&url=http%3A%2F%2Fwww.globussoft.com&via=WhitentonSkoff"), "", "");

                    try
                    {
                        Text = getBetween(Response, "name=\"text\" type=\"hidden\" value=\"", "\"");
                    }
                    catch { };

                    try
                    {
                        AuthencityToken = getBetween(Response, "authenticity_token\" value=\"", "\"");
                    }
                    catch { };

                    try
                    {
                        tw_p = getBetween(Response, "\"tw_p\" type=\"hidden\" value=\"", "\"");
                    }
                    catch { };

                    try
                    {
                        via = getBetween(Response, "\"via\" type=\"hidden\" value=\"", "\"");
                    }
                    catch
                    { };

                    try
                    {
                        OrignalReferer = getBetween(Response, "original_referer=", "&");
                    }
                    catch { };

                    try
                    {
                        string postData    = "Url=" + Uri.EscapeDataString(item) + "&Text=" + Uri.EscapeDataString(Text).Replace(" ", "+") + "&original_referer=" + Uri.EscapeDataString(OrignalReferer) + "&via=" + via + "&tw_p=" + tw_p + "&authenticity_token=" + AuthencityToken + "&status=Twitter+Buttons+%7C+About" + Uri.EscapeDataString(item) + "via" + Uri.EscapeDataString(via);
                        string postUrl     = "https://twitter.com/intent/tweet/update";
                        string PostRequest = tweetAccountManager.globusHttpHelper.postFormData(new Uri(postUrl), postData, "", "", "", "", "");
                        if (PostRequest.Contains("Your Tweet has been posted!"))
                        {
                            AddToWebsiteLikeLog("[ " + DateTime.Now + " ] => [ Your Tweet has been posted ]");
                            Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(item, Globals.Path_SuccessfullyTweetedUrls);
                        }
                        else if (PostRequest.Contains("You have already sent this Tweet"))
                        {
                            AddToWebsiteLikeLog("[ " + DateTime.Now + " ] => [ You have already sent this Tweet]");
                        }
                        else
                        {
                            AddToWebsiteLikeLog("[ " + DateTime.Now + " ] => [ Your Tweet has not been posted ]");
                        }
                    }
                    catch { };
                }
                catch
                { };
            }

            AddToWebsiteLikeLog("[ " + DateTime.Now + " ] => [ Process Completed ........ ]");
        }
コード例 #7
0
ファイル: frmMain.cs プロジェクト: prog-moh/twtboard
        public void getLoginandCheckAccount()
        {
            AddToLog_Checker("Process start");

            try
            {
                

                //Get individual Email from Email list 

                foreach (string item in listOfTwitterEmailIdAndPassword)
                {
                    TweetAccountManager tweetAccountManager = new TweetAccountManager();

                    GlobusHttpHelper globushttpHelper1 = new GlobusHttpHelper();

                    string userEmail = item.Split(':')[0];
                    string userEmailPass = item.Split(':')[1];

                    tweetAccountManager.Username = userEmail;
                    tweetAccountManager.Password = userEmailPass;


                    if (!tweetAccountManager.IsLoggedIn)
                    {
                        tweetAccountManager.Login();
                    }


                    if (tweetAccountManager.IsLoggedIn)
                    {
                        AddToLog_Checker("Log in Success " + userEmail);

                        //get data from API Url ...
                        string userID = tweetAccountManager.userID;

                        string URL = "https://api.twitter.com/1/users/show.json?user_id=" + userID + "&include_entities=true";


                        try
                        {
                            string Data = globushttpHelper1.getHtmlfromUrl(new Uri(URL), "", "");


                            //parse data from Json..
                            JObject JData = JObject.Parse(Data);
                            string ScreanName = (string)JData["screen_name"];

                            //get write data in CSV file ...
                            if (!string.IsNullOrEmpty(userID) && !string.IsNullOrEmpty(ScreanName))
                            {
                                if (!File.Exists(Globals.Path_CheckAccountByEmail))
                                {
                                    string Header = "Email" + "," + "User Id" + "," + "Screan Name";
                                    GlobusFileHelper.AppendStringToTextfileNewLine(Header, Globals.Path_CheckAccountByEmail);
                                }

                                string CheckAccountByEmail_Data = userEmail + "," + userID + "," + ScreanName;
                                if (!string.IsNullOrEmpty(userEmail))
                                {
                                    GlobusFileHelper.AppendStringToTextfileNewLine(CheckAccountByEmail_Data, Globals.Path_CheckAccountByEmail);
                                    AddToLog_Checker(userEmail + "-" + userID + "-" + ScreanName);
                                }
                            }
                        }
                        catch (Exception)
                        {

                        }
                    }
                }
                AddToLog_Checker("Finished Account Checking");
                AddToLog_Checker("------------------------------------------------------------------------------------------------------------------------------------------");
            }
            catch (Exception)
            {
            }

            finally
            {
                AddToLog_Checker("Finish Account Checking For all Emails");
            }
        }
コード例 #8
0
        private void Start_ReplyMultithreaded(object parameters)
        {
            try
            {
                Array paramsArray = new object[2];

                paramsArray = (Array)parameters;

                KeyValuePair <string, TweetAccountManager> keyValue = (KeyValuePair <string, TweetAccountManager>)paramsArray.GetValue(0);


                List <string> list_userIDsToFollow = new List <string>();//(List<string>)paramsArray.GetValue(1);

                TweetAccountManager tweetAccountManager = keyValue.Value;

                if (tweetAccountManager.Username == userName)
                {
                    if (userDisplayName.Length + screenName.Length + message.Length < 140)
                    {
                        //tweetAccountManager.unFollower.logEvents.addToLogger += new EventHandler(logEvents_UnFollower_addToLogger);
                        tweetAccountManager.logEvents.addToLogger += new EventHandler(ReplyInterface_AddToLogger);

                        if (!tweetAccountManager.IsLoggedIn)
                        {
                            tweetAccountManager.Login();
                        }

                        if (tweetAccountManager.AccountStatus == "Account Suspended")
                        {
                            clsDBQueryManager database = new clsDBQueryManager();
                            database.UpdateSuspendedAcc(tweetAccountManager.Username);

                            AddToReplyInterfaceLog("[ " + DateTime.Now + " ] => [ Account Suspended With User Name : " + tweetAccountManager.Username + " ]");
                            return;
                        }

                        tweetAccountManager.Reply_MentionReplyInterface(PostAuthenticityToken, statusId, userDisplayName, screenName, message, userName);

                        tweetAccountManager.logEvents.addToLogger -= ReplyInterface_AddToLogger;

                        BindData();
                    }
                    else
                    {
                        MessageBox.Show("Please Edit  The Message Of Edit Message Box . Since The Message Length Is Greater Than 140 Characters !");
                        return;
                    }
                }
            }
            catch
            {
            }

            finally
            {
                try
                {
                    // BindData();
                }
                catch
                {
                }
            }
        }
コード例 #9
0
        private void StartMessagingMultithreaded(object parameters)
        {
            try
            {
                if (IsStopDirectMessages)
                {
                    return;
                }

                if (!IsStopDirectMessages)
                {
                    lstIsStopMessaging.Add(Thread.CurrentThread);
                    lstIsStopMessaging.Distinct();
                    Thread.CurrentThread.IsBackground = true;
                }
                List <string> list_userIDsToFollow = new List <string>();
                Array         paramsArray          = new object[2];

                paramsArray = (Array)parameters;
                int NoOfFollwos = 0;
                KeyValuePair <string, TweetAccountManager> keyValue = (KeyValuePair <string, TweetAccountManager>)paramsArray.GetValue(0);
                string NofUnfollows = (string)paramsArray.GetValue(1);
                if (!string.IsNullOrEmpty(NofUnfollows) && NumberHelper.ValidateNumber(NofUnfollows))
                {
                    NoOfFollwos = Int32.Parse(NofUnfollows);
                }
                bool OtherUser = false;
                //frmMain_NewUI.IsFollowerScreenName = true;

                GlobusHttpHelper    objGlobusHttpHelper = new GlobusHttpHelper();
                TweetAccountManager tweetAccountManager = keyValue.Value;
                tweetAccountManager.unFollower.logEvents.addToLogger += new EventHandler(logEvents_Follower_addToLogger);
                tweetAccountManager.logEvents.addToLogger            += logEvents_Follower_addToLogger;

                if (!tweetAccountManager.IsLoggedIn)
                {
                    tweetAccountManager.Login();
                }

                if (!tweetAccountManager.IsLoggedIn)
                {
                    AddToLog_follow("[ " + DateTime.Now + " ] => [ Not Logged In With Account : " + keyValue.Key + " ]");
                    return;
                }
                if (GlobusRegex.ValidateNumber(txtDirectMessageMinDelay.Text))
                {
                    followMinDelay = Convert.ToInt32(txtDirectMessageMinDelay.Text);
                }
                if (GlobusRegex.ValidateNumber(txtDirectMessageMaxDelay.Text))
                {
                    followMaxDelay = Convert.ToInt32(txtDirectMessageMaxDelay.Text);
                }
                //TwitterDataScrapper objTwitterDataScrapper = new TwitterDataScrapper();

                if (list_userIDsToFollowForDirectMessage.Count > 0 && chkFollowers.Checked)
                {
                    list_userIDsToFollow.AddRange(list_userIDsToFollowForDirectMessage);
                }
                else
                {
                    list_userIDsToFollow = tweetAccountManager.GetFollowerListForDirectMessage();
                }

                if (list_userIDsToFollow.Count > 0)
                {
                    tweetAccountManager.PostDirectMessage(list_userIDsToFollow, followMinDelay, followMaxDelay, OtherUser);
                }
                else
                {
                    AddToLog_follow("[ " + DateTime.Now + " ] => [ No user id is available for Account : " + keyValue.Key + " ]");
                }

                tweetAccountManager.unFollower.logEvents.addToLogger -= logEvents_Follower_addToLogger;
                tweetAccountManager.logEvents.addToLogger            -= logEvents_Follower_addToLogger;
            }
            catch (Exception ex)
            {
                ErrorLogger.AddToErrorLogText(ex.Message);
                GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> StartUnFollowingMultithreaded()  --> " + ex.Message, Globals.Path_UnfollowerErroLog);
                GlobusFileHelper.AppendStringToTextfileNewLine("Error --> StartUnFollowingMultithreaded() --> " + ex.Message, Globals.Path_TwtErrorLogs);
            }

            finally
            {
                counter_Account--;
                if (counter_Account == 0)
                {
                    if (btnStartMessaging.InvokeRequired)
                    {
                        btnStartMessaging.Invoke(new MethodInvoker(delegate
                        {
                            AddToLog_follow("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                            AddToLog_follow("---------------------------------------------------------------------------------------------------------------------------");
                            btnStartMessaging.Cursor = Cursors.Default;
                        }));
                    }
                }
            }
        }