Exemplo n.º 1
0
        public async Task <IResult <InstaMediaList> > GetMediaByUser(string User)
        {
            try
            {
                var Credentials = new UserSessionData();
                Credentials.UserName = "******";
                Credentials.Password = "******";

                var Api = InstagramClient
                          .SetUser(Credentials)
                          .Build();

                var Result = await Api.LoginAsync();

                Console.WriteLine(Result.Succeeded);

                var Parameters = PaginationParameters.MaxPagesToLoad(10);
                IResult <InstaMediaList> Media = await Api.GetUserMediaAsync(User, Parameters);
                await UploadMedia(Media, User);

                return(Media);
            }

            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            return(null);
        }