private void LikePosts(string[] posts, InstagramAccount account) { var insta = new InstagramControl(); insta.RunInstagram(); insta.Login(account.AccountName, account.InstagramPass, false); Thread.Sleep(1000); foreach (var post in posts) { insta.LikePost(post); } insta.Logout(); }
public void StartLike(string tag, int count, InstagramAccount account) { var instagram = new InstagramControl(); instagram.Login(account.AccountName, account.InstagramPass, false); Thread.Sleep(2000); instagram.TagPostsFind(tag); postUrls = new string[count]; Thread.Sleep(1000); for (int i = 0; i < count; i++) { var res = instagram.GetPostUrl(); if (i != 0) { if (postUrls[i - 1] != res) { postUrls[i] = res; } else { i--; } } else { postUrls[i] = res; } } //instagram.ReturnHome(); instagram.ReturnHome(); Thread.Sleep(2000); foreach (var item in postUrls) { instagram.LikePost(item); } //instagram.ReturnHome(); instagram.Logout(); }