Esempio n. 1
0
        private async Task <bool> GetSeleniumUserId()
        {
            var users = new InstaSharp.Endpoints.Users(ApiConfig);

            UserId = (await users.Search(UserName, 1)).Data[0].Id;
            return(UserId > 0);
        }
Esempio n. 2
0
        /// <summary>
        /// Returns list of followers for selected user
        /// </summary>
        /// <param name="userName">User Name</param>
        /// <returns></returns>
        public override async Task <IEnumerable <InstaSharp.Models.User> > GetContactsListAsync(string userName)
        {
            var users     = new InstaSharp.Endpoints.Users(ApiConfig);
            var foundUser = await users.Search(userName, 1);

            var relationships = new InstaSharp.Endpoints.Relationships(ApiConfig);

            if (foundUser == null || foundUser.Data.Count == 0)
            {
                return(null);
            }
            var followers = await relationships.FollowedBy(foundUser.Data[0].Id);

            return(followers.Data);
        }
Esempio n. 3
0
        public async Task <ActionResult> MyFeed()
        {
            var oAuthResponse = Session["InstaSharp.AuthInfo"] as OAuthResponse;

            if (oAuthResponse == null)
            {
                return(RedirectToAction("Login"));
            }

            var users = new InstaSharp.Endpoints.Users(config, oAuthResponse);

            var feed = await users.Search("vaiserteta", null);

            return(View(feed.Data));
        }
Esempio n. 4
0
 private async Task<bool> GetSeleniumUserId()
 {
     var users = new InstaSharp.Endpoints.Users(ApiConfig);
     UserId = (await users.Search(UserName, 1)).Data[0].Id;
     return UserId > 0;
 }
Esempio n. 5
0
 /// <summary>
 /// Returns list of followers for selected user
 /// </summary>
 /// <param name="userName">User Name</param>
 /// <returns></returns>
 public override async Task<IEnumerable<InstaSharp.Models.User>> GetContactsListAsync(string userName)
 {
     var users = new InstaSharp.Endpoints.Users(ApiConfig);
     var foundUser = await users.Search(userName, 1);
     var relationships = new InstaSharp.Endpoints.Relationships(ApiConfig);
     if (foundUser == null || foundUser.Data.Count == 0)
     {
         return null;
     }
     var followers = await relationships.FollowedBy(foundUser.Data[0].Id);
     return followers.Data;
 }