Exemplo n.º 1
0
        public void LikeSnapsVideos(ref InstagramAccountManager accountManager, string url)
        {
            string user       = accountManager.Username;
            string likeStatus = string.Empty;

            ClGlobul.checkHashTagLiker = true;
            InstagramPhotoLike objInstagramPhotoLike = new InstagramPhotoLike();

            try
            {
                DataSet DS = DataBaseHandler.SelectQuery("select like_status from liker_hash_tag where account_holder ='" + user + "' and photo_id ='" + url.Replace("http://websta.me/p/", string.Empty) + "'", "liker_hash_tag");
                if (DS.Tables[0].Rows.Count != 0)
                {
                    likeStatus = DS.Tables[0].Rows[0].ItemArray[0].ToString();
                }
            }
            catch (Exception ex)
            { }
            try
            {
                if (!(likeStatus == "LIKED"))
                {
                    if (!(counterLike == ClGlobul.NumberofSnapsVideosToLike))
                    {
                        string response = objInstagramPhotoLike.photolike(url, ref accountManager);
                        Thread.Sleep(ClGlobul.hashTagDelay * 1000);
                        counterLike++;
                        if (response == "LIKED")
                        {
                            Log("[ " + DateTime.Now + "] " + "[ Snap/Video liked with url : " + url + " ]");
                        }
                        else
                        {
                            Log("[ " + DateTime.Now + "] " + "[ Snap/Video not liked with url : " + url + " ]");
                        }
                    }
                    else
                    {
                        ClGlobul.isLikeLimitReached = true;
                        Log("[ " + DateTime.Now + "] " + " [ " + ClGlobul.NumberofSnapsVideosToLike + " snaps/videos liked ]");
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 2
0
        public void CommentOnSnapsVideos(ref InstagramAccountManager accountManager, string url)
        {
            Comments           objComments           = new Comments();
            InstagramPhotoLike objInstagramPhotoLike = new InstagramPhotoLike();
            string             message = string.Empty;

            ClGlobul.checkHashTagComment = true;
            string user          = accountManager.Username;
            string commentStatus = string.Empty;
            string likeStatus    = string.Empty;

            try
            {
                try
                {
                    if (ClGlobul.HashCommentMessage.Count == ClGlobul.NumberofSnapsVideosToComment)
                    {
                        message = ClGlobul.HashCommentMessage[i];
                        i++;
                    }
                    else
                    {
                        message = ClGlobul.HashCommentMessage[RandomNumberGenerator.GenerateRandom(0, ClGlobul.HashCommentMessage.Count)];
                    }
                }
                catch (Exception ex)
                { }
                try
                {
                    try
                    {
                        DataSet commentDS = DataBaseHandler.SelectQuery("select comment_status from comment_hash_tag where account_holder ='" + user + "' and photo_id = '" + url.Replace("http://websta.me/p/", string.Empty) + "'", "comment_hash_tag");
                        if (commentDS.Tables[0].Rows.Count != 0)
                        {
                            commentStatus = commentDS.Tables[0].Rows[0].ItemArray[0].ToString();
                        }
                    }
                    catch (Exception ex)
                    { }
                    try
                    {
                        DataSet likeDS = DataBaseHandler.SelectQuery("select like_status from liker_hash_tag where account_holder ='" + user + "' and photo_id ='" + url.Replace("http://websta.me/p/", string.Empty) + "'", "liker_hash_tag");
                        if (likeDS.Tables[0].Rows.Count != 0)
                        {
                            likeStatus = likeDS.Tables[0].Rows[0].ItemArray[0].ToString();
                        }
                    }
                    catch (Exception ex)
                    { }
                }
                catch (Exception ex)
                {}

                if (!(commentStatus == "Success"))
                {
                    if (!(counterComment == ClGlobul.NumberofSnapsVideosToComment))
                    {
                        string status = objComments.Comment(url, message, ref accountManager);
                        Thread.Sleep(ClGlobul.hashTagDelay * 1000);
                        if (status == "Success")
                        {
                            Log("[ " + DateTime.Now + "] " + "[ Commented on snap/video with url : " + url + " with this message : " + message + " ]");
                        }
                        else
                        {
                            Log("[ " + DateTime.Now + "] " + "[ Could not comment on snap/video with url : " + url + " ]");
                        }

                        if (ClGlobul.isCommentAndLikeChecked == true)
                        {
                            if (!(likeStatus == "LIKED"))
                            {
                                ClGlobul.checkHashTagLiker = true;
                                string photoStatus = objInstagramPhotoLike.photolike(url, ref accountManager);
                                Thread.Sleep(ClGlobul.hashTagDelay * 1000);
                                if (photoStatus == "LIKED")
                                {
                                    Log("[ " + DateTime.Now + "] " + "[ Snap/Video liked with url : " + url + " ]");
                                }
                                else
                                {
                                    Log("[ " + DateTime.Now + "] " + "[ Snap/Video not liked with url : " + url + " ]");
                                }
                            }
                            else
                            {
                                Log("[ " + DateTime.Now + "] " + "[ Snap/video with url : " + url + " is already liked. ]");
                            }
                        }
                        counterComment++;
                    }
                    else
                    {
                        ClGlobul.isCommentLimitReached = true;
                        Log("[ " + DateTime.Now + "] " + "[ Commented on " + ClGlobul.NumberofSnapsVideosToLike + " snaps/videos. ");
                        return;
                    }
                }
            }
            catch (Exception ex)
            { }
        }