public string GetPhotos() { var config = InstagramHelper.GetConfig(); var authInfo = InstagramHelper.GetAuthInfo(); var users = new InstaSharp.Endpoints.Users.Authenticated(config, authInfo); var result = users.Feed("self"); return JsonConvert.SerializeObject(result); }
public void GetPhotos() { InstagramController controller = new InstagramController(); // Arrange var config = InstagramHelper.GetConfig(); var authInfo = InstagramHelper.GetAuthInfo(); var users = new InstaSharp.Endpoints.Users.Authenticated(config, authInfo); // Act var result = users.Feed("self"); // Assert }
public void saveRecentImages() { var users = new InstaSharp.Endpoints.Users.Authenticated(config, authInfo); var result = users.Feed(user_name); dynamic imagesList = JsonConvert.DeserializeObject(result.Json); string projectPath = Environment.CurrentDirectory; projectPath = projectPath.Substring(0, projectPath.Length - 9); var webClient = new WebClient(); int count = 1; foreach (var data in imagesList.data) { string img_url = data.images.standard_resolution.url; System.Drawing.Image img = GetImageFromUrl(img_url); img.Save(projectPath + "Content/SleepScreen/Instagram/" + count + ".jpg"); count++; } webClient.Dispose(); }