예제 #1
0
파일: HashTag.cs 프로젝트: kuggaa/gramboard
        public void FollowUrls(ref InstagramAccountManager accountManager, string url)
        {
            //Thread.Sleep(2000);
            string followStatus = string.Empty;

            try
            {
                string          user = accountManager.Username;
                InstagramFollow objInstagramFollow = new InstagramFollow();
                try
                {
                    DataSet DS = DataBaseHandler.SelectQuery("Select FollowStatus from FollowInfo where AccountHolder='" + user + "' and FollowingUser='******'", "FollowInfo");
                    if (DS.Tables[0].Rows.Count != 0)
                    {
                        followStatus = DS.Tables[0].Rows[0].ItemArray[0].ToString();
                    }
                }
                catch (Exception ex)
                { }
                if (!(followStatus == "Followed"))
                {
                    //if (!(counterFollow == ClGlobul.NumberOfProfilesToFollow))
                    {
                        string status = objInstagramFollow.Follow(url, ref accountManager);
                        // Thread.Sleep(ClGlobul.hashTagDelay * 1000);
                        counterFollow++;
                        if (status == "Followed")
                        {
                            Log("[ " + DateTime.Now + "] " + "[ Profile followed with url : " + url + " with User = "******" ]");
                        }
                        else
                        {
                            Log("[ " + DateTime.Now + "] " + "[ Profile not followed with url : " + url + " with User = "******" ]");
                            //Log("[ " + DateTime.Now + "] " + " [ " + ClGlobul.NumberOfProfilesToFollow + " profiles Unfollowed ]");
                        }
                    }
                    //else
                    {
                        //ClGlobul.isFollowLimitReached = true;
                        //Log("[ " + DateTime.Now + "] " + " [ " + ClGlobul.NumberOfProfilesToFollow + " profiles followed ]");
                        // return;
                    }
                }
            }
            catch (Exception ex)
            {
                GramBoardProFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> btnMsgFrom_Click() --> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, GramBoardProFileHelper.ErrorLogFilePath);
            }
        }
예제 #2
0
        public void FollowUrls(ref InstagramAccountManager accountManager, string url)
        {
            //Thread.Sleep(2000);
            string followStatus = string.Empty;
            try
            {
                string user = accountManager.Username;
                InstagramFollow objInstagramFollow = new InstagramFollow();
                try
                {
                    DataSet DS = DataBaseHandler.SelectQuery("Select FollowStatus from FollowInfo where AccountHolder='" + user + "' and FollowingUser='******'", "FollowInfo");
                    if (DS.Tables[0].Rows.Count != 0)
                    {
                        followStatus = DS.Tables[0].Rows[0].ItemArray[0].ToString();
                    }
                }
                catch(Exception ex)
                { }
                if (!(followStatus == "Followed"))
                {
                    //if (!(counterFollow == ClGlobul.NumberOfProfilesToFollow))
                    {

                        string status = objInstagramFollow.Follow(url, ref accountManager);
                       // Thread.Sleep(ClGlobul.hashTagDelay * 1000);
                        counterFollow++;
                        if (status == "Followed")
                        {
                            Log("[ " + DateTime.Now + "] " + "[ Profile followed with url : " + url + " with User = "******" ]");
                        }
                        else
                        {
                            Log("[ " + DateTime.Now + "] " + "[ Profile not followed with url : " + url + " with User = "******" ]");
                            //Log("[ " + DateTime.Now + "] " + " [ " + ClGlobul.NumberOfProfilesToFollow + " profiles Unfollowed ]");
                        }
                    }
                   //else
                    {
                        //ClGlobul.isFollowLimitReached = true;
                        //Log("[ " + DateTime.Now + "] " + " [ " + ClGlobul.NumberOfProfilesToFollow + " profiles followed ]");
                       // return;
                    }
                }
            }
            catch (Exception ex)
            {
                GramBoardProFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> btnMsgFrom_Click() --> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, GramBoardProFileHelper.ErrorLogFilePath);
            }
        }