Exemplo n.º 1
0
        public void StartDMMultiThreadedGroupUser(object parameter)
        {
            try
            {
                try
                {
                    if (!IsStop)
                    {
                        lstGroupUpdateThread.Add(Thread.CurrentThread);
                        lstGroupUpdateThread.Distinct().ToList();
                        Thread.CurrentThread.IsBackground = true;
                    }
                }
                catch
                {
                }
                Array paramsArray = new object[1];
                paramsArray = (Array)parameter;

                KeyValuePair<string, LinkedInMaster> item = (KeyValuePair<string, LinkedInMaster>)paramsArray.GetValue(0);
                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;

                GlobusHttpHelper HttpHelper = new GlobusHttpHelper();

                Groups.GroupUpdate obj_GroupUpdate = new Groups.GroupUpdate(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword);

                obj_GroupUpdate.logger.addToLogger += new EventHandler(AddToLogger_GroupStatus);

                Login.logger.addToLogger += new EventHandler(AddToLogger_GroupStatus);

                if (!Login.IsLoggedIn)
                {
                    Login.LoginHttpHelper(ref HttpHelper);
                }

                AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ Starting Search For Groups >>> To Send Group Messages ]");

                try
                {
                    if (Login.IsLoggedIn)
                    {
                        GroupStatus dataScrape = new GroupStatus();
                        Dictionary<string, string> Data = new Dictionary<string, string>();
                        Data.Clear();

                        Data = obj_GroupUpdate.PostCreateGroupNames(ref HttpHelper, Login.accountUser);
                        GrpMess.Add(Login.accountUser, Data);
                        obj_GroupUpdate.logger.addToLogger -= new EventHandler(AddToLogger_GroupStatus);

                        if (cmbGroupUser.InvokeRequired)
                        {
                            new Thread(() =>
                            {
                                cmbGroupUser.Invoke(new MethodInvoker(delegate
                                {
                                    cmbGroupUser.Items.Add(Login.accountUser);
                                }));
                            }).Start();
                        }

                        AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ Groups Added in : " + item.Value._Username + "]");
                    }
                    else
                    {
                        AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ LinkedIn account : " + Login.accountUser + " has been temporarily restricted ]");
                    }
                }
                catch (Exception ex)
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> StartDMMultiThreadedGroupUser() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> StartDMMultiThreadedGroupUser() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinGetGroupMemberErrorLogs);
                }
                finally
                {
                    counter_GroupMemberSearch--;

                    if (counter_GroupMemberSearch == 0)
                    {
                        if (cmbGroupUser.InvokeRequired)
                        {
                            cmbGroupUser.Invoke(new MethodInvoker(delegate
                            {
                                AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                                AddLoggerGroupStatus("-------------------------------------------------------------------------------------------------------------------------");
                                cmbGroupUser.Enabled = true;
                                btnGetUser.Cursor = Cursors.Default;

                            }));
                        }

                        //btnGetUser.Invoke(new MethodInvoker(delegate
                        //{
                        //    AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                        //    AddLoggerGroupStatus("-------------------------------------------------------------------------------------------------------------------------");

                        //    btnGetUser.Cursor = Cursors.Default;
                        //}));
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> StartDMMultiThreadedGroupUser() >>>> " + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> StartDMMultiThreadedGroupUser() >>>> " + ex.StackTrace, Globals.Path_LinkedinGetGroupMemberErrorLogs);
            }
        }
Exemplo n.º 2
0
        public void PostUpdateLiker(object parameter)
        {
            try
            {
                try
                {
                    if (!IsStop)
                    {
                        lstGroupUpdateThread.Add(Thread.CurrentThread);
                        lstGroupUpdateThread.Distinct().ToList();
                        Thread.CurrentThread.IsBackground = true;
                    }
                }
                catch
                {
                }

                Array paramsArray = new object[1];

                paramsArray = (Array)parameter;

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

                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;
                string user = item.Key;

                Groups.GroupUpdate obj_GroupUpdate = new Groups.GroupUpdate(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword);

                Login.logger.addToLogger           += new EventHandler(AddToLogger_GroupStatus);
                obj_GroupUpdate.logger.addToLogger += new EventHandler(AddToLogger_GroupStatus);

                if (!Login.IsLoggedIn)
                {
                    Login.LoginHttpHelper(ref HttpHelper);
                    //AddLoggerGroupAdd("Login Process completed..  ");
                }

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

                if (chkUpdateCollection.InvokeRequired)
                {
                    chkUpdateCollection.Invoke(new MethodInvoker(delegate
                    {
                        foreach (string Userid in chkUpdateCollection.CheckedItems)
                        {
                            string[] Uid = Userid.Split('#');
                            GetCheckedItems.Add(Uid[1]);
                        }
                    }));
                }

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

                foreach (KeyValuePair <string, Dictionary <string, string> > NewValue in GrpMess)
                {
                    if (NewValue.Key == item.Key)
                    {
                        foreach (KeyValuePair <string, string> GroupId in NewValue.Value)
                        {
                            foreach (string selectedgroup in GetCheckedItems)
                            {
                                if (GroupId.Key.Contains(selectedgroup))
                                {
                                    SelectedItem.Add(GroupId + "#" + selectedgroup);
                                }
                            }
                        }
                    }
                }


                int minDelay = 20;
                int maxDelay = 25;

                if (!string.IsNullOrEmpty(txtGroupUpdateMinDelay.Text) && NumberHelper.ValidateNumber(txtGroupUpdateMinDelay.Text))
                {
                    minDelay = Convert.ToInt32(txtGroupUpdateMinDelay.Text);
                }
                if (!string.IsNullOrEmpty(txtGroupUpdateMaxDelay.Text) && NumberHelper.ValidateNumber(txtGroupUpdateMaxDelay.Text))
                {
                    maxDelay = Convert.ToInt32(txtGroupUpdateMaxDelay.Text);
                }

                obj_GroupUpdate.PostCommentLikerUpdate(ref HttpHelper, SelectedItem, new object[] { item, user }, minDelay, maxDelay);
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Update Liker --> PostUpdateLiker() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Update Liker --> PostUpdateLiker() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinGetGroupMemberErrorLogs);
            }
            finally
            {
                counter_GroupMemberSearch--;
                int cnt = LinkedInManager.linkedInDictionary.Count - 1;
                if (counter_GroupMemberSearch == cnt)
                {
                    if (btnUpdateLike.InvokeRequired)
                    {
                        btnUpdateLike.Invoke(new MethodInvoker(delegate
                        {
                            AddLoggerCommentLiker("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                            AddLoggerCommentLiker("---------------------------------------------------------------------------------------------------------------------------");
                            btnUpdateLike.Cursor = Cursors.Default;
                        }));
                    }
                }
            }
        }
Exemplo n.º 3
0
        public void PostGroupMsgUpdate(object parameter)
        {
            try
            {
                try
                {
                    if (!IsStop)
                    {
                        lstGroupUpdateThread.Add(Thread.CurrentThread);
                        lstGroupUpdateThread.Distinct().ToList();
                        Thread.CurrentThread.IsBackground = true;
                    }
                }
                catch
                {
                }

                Array paramsArray = new object[1];

                paramsArray = (Array)parameter;

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

                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;
                string user = item.Key;

                Groups.GroupUpdate obj_GroupUpdate = new Groups.GroupUpdate(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword);

                Login.logger.addToLogger += new EventHandler(AddToLogger_GroupStatus);
                obj_GroupUpdate.logger.addToLogger += new EventHandler(AddToLogger_GroupStatus);

                if (!Login.IsLoggedIn)
                {
                    Login.LoginHttpHelper(ref HttpHelper);
                }

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

                if (chkGroupCollection.InvokeRequired)
                {
                    chkGroupCollection.Invoke(new MethodInvoker(delegate
                    {
                        foreach (string Userid in chkGroupCollection.CheckedItems)
                        {
                            string[] Uid = Userid.Split(':');
                            GetCheckedItems.Add(Uid[1]);
                        }
                    }));
                }

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

                foreach (KeyValuePair<string, Dictionary<string, string>> NewValue in GrpMess)
                {
                    if (NewValue.Key == item.Key)
                    {
                        foreach (KeyValuePair<string, string> GroupId in NewValue.Value)
                        {
                            foreach (string selectedgroup in GetCheckedItems)
                            {
                                if (GroupId.Key.Contains(selectedgroup))
                                {
                                    SelectedItem.Add(GroupId + ":" + selectedgroup);

                                }
                            }
                        }
                    }
                }

                int minDelay = 20;
                int maxDelay = 25;

                if (!string.IsNullOrEmpty(txtGroupUpdateMinDelay.Text) && NumberHelper.ValidateNumber(txtGroupUpdateMinDelay.Text))
                {
                    minDelay = Convert.ToInt32(txtGroupUpdateMinDelay.Text);
                }
                if (!string.IsNullOrEmpty(txtGroupUpdateMaxDelay.Text) && NumberHelper.ValidateNumber(txtGroupUpdateMaxDelay.Text))
                {
                    maxDelay = Convert.ToInt32(txtGroupUpdateMaxDelay.Text);
                }

                if (chkSameMessageForAllGroup.Checked)
                {

                    obj_GroupUpdate.PostGroupSameMessageForAllGroup(ref HttpHelper, SelectedItem, new object[] { item, user }, minDelay, maxDelay);
                    return;
                }

                if (!chkAttachLinkGroupUpdate.Checked == true)
                {
                    obj_GroupUpdate.PostGroupMsg(ref HttpHelper, SelectedItem, new object[] { item, user }, minDelay, maxDelay);

                }
                else
                {
                    obj_GroupUpdate.PostAttachLinkGroupUpdate(ref HttpHelper, SelectedItem, new object[] { item, user }, minDelay, maxDelay);
                }

                Thread.Sleep(2000);
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> PostGroupMsgUpdate() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> PostGroupMsgUpdate() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinGetGroupMemberErrorLogs);
            }
            finally
            {
                counter_GroupMemberSearch--;
                int cnt = LinkedInManager.linkedInDictionary.Count - 1;
                if (counter_GroupMemberSearch == cnt)
                {
                    if (btnGroupUpdate.InvokeRequired)
                    {
                        btnGroupUpdate.Invoke(new MethodInvoker(delegate
                        {
                            AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                            AddLoggerGroupStatus("----------------------------------------------------------------------------------------------------------------------------");
                            btnGroupUpdate.Enabled = true;
                            btnGroupUpdate.Cursor = Cursors.Default;

                        }));
                    }
                }

            }
        }
Exemplo n.º 4
0
        public void StartDMMultiThreadedGroupUser(object parameter)
        {
            try
            {
                Array paramsArray = new object[1];
                paramsArray = (Array)parameter;

                KeyValuePair <string, LinkedInMaster> item = (KeyValuePair <string, LinkedInMaster>)paramsArray.GetValue(0);
                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;

                GlobusHttpHelper HttpHelper = new GlobusHttpHelper();

                Groups.GroupUpdate obj_GroupUpdate = new Groups.GroupUpdate(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword);

                obj_GroupUpdate.logger.addToLogger += new EventHandler(AddToLogger_GroupStatus);

                if (!Login.IsLoggedIn)
                {
                    Login.LoginHttpHelper(ref HttpHelper);
                    AddLoggerCommentLiker("[ " + DateTime.Now + " ] => [ Loggin In With Email : " + item.Value._Username);
                }

                AddLoggerCommentLiker("[ " + DateTime.Now + " ] => [ Starting Search For comments >>> To Like ]");

                try
                {
                    if (Login.IsLoggedIn)
                    {
                        GroupStatus dataScrape           = new GroupStatus();
                        Dictionary <string, string> Data = new Dictionary <string, string>();
                        Data.Clear();

                        Data = obj_GroupUpdate.PostCommentsForLiker(ref HttpHelper, Login.accountUser);

                        GrpMess.Add(Login.accountUser, Data);

                        obj_GroupUpdate.logger.addToLogger -= new EventHandler(AddToLogger_GroupStatus);

                        if (cmbGroupUser.InvokeRequired)
                        {
                            new Thread(() =>
                            {
                                cmbGroupUser.Invoke(new MethodInvoker(delegate
                                {
                                    cmbGroupUser.Items.Add(Login.accountUser);
                                }));
                            }).Start();
                        }

                        AddLoggerCommentLiker("[ " + DateTime.Now + " ] => [ Comment Added in : " + item.Value._Username + " ]");
                    }
                    else
                    {
                        AddLoggerCommentLiker("[ " + DateTime.Now + " ] => [ LinkedIn account : " + Login.accountUser + " has been temporarily restricted ]");
                    }
                }
                catch (Exception ex)
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> StartDMMultiThreadedGroupUser() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> StartDMMultiThreadedGroupUser() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinGetGroupMemberErrorLogs);
                }
                finally
                {
                    counter_GroupMemberSearch--;

                    if (counter_GroupMemberSearch == 0)
                    {
                        if (cmbGroupUser.InvokeRequired)
                        {
                            cmbGroupUser.Invoke(new MethodInvoker(delegate
                            {
                                AddLoggerCommentLiker("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                                AddLoggerCommentLiker("----------------------------------------------------------------------------------------------------------");
                                cmbGroupUser.Enabled = true;
                                btnGetUser.Cursor    = Cursors.Default;
                            }));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> StartDMMultiThreadedGroupUser() >>>> " + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> StartDMMultiThreadedGroupUser() >>>> " + ex.StackTrace, Globals.Path_LinkedinGetGroupMemberErrorLogs);
            }
        }