private void GetInstaPhotos(string instaPath, InstagramPhotoCollection instagram) { Directory.CreateDirectory(instaPath); int max = Math.Min(6, instagram.Photos.Length); for (int i = 0; i < max; ++i) { InstagramPhotos[i].ImageLocation = instagram.Photos[i].DownloadToFolder(instaPath); } }
private void SaveInsta(InstagramPhotoCollection instagram, string path, bool otherStalkerInfo = false) { if (!Directory.Exists(_curSavedPath)) { Directory.CreateDirectory(_curSavedPath); } //var instagram = profile.InstagramPhotos; if (instagram != null && !Directory.Exists(path) && Directory.Exists(_curTempPath + "instagram")) { Directory.CreateDirectory(path); foreach (var photo in Directory.GetFiles(_curTempPath + "instagram")) { File.Copy(photo, path + Path.GetFileName(photo)); } if (instagram.Photos.Length > 6) { foreach (var instaPhoto in instagram.Photos.Skip(6)) { instaPhoto.DownloadToFolder(path); } } instagram.DownloadProfilePicToFolder(path); /* * if (otherStalkerInfo) * new Dictionary<string, string>() * { * { "username", instagram.Username }, * { "media_count", instagram.AccountNumPhotos.ToString() }, * { "last_fetch_time", instagram.LastFetch.ToString() }, * { * "birth_date", * !String.IsNullOrWhiteSpace(profile.BirthdayInfo) ? * ((int)((DateTime.Now - profile.Birthday).TotalDays / 365.25)).ToString() : * profile.Birthday.ToShortDateString() * }, * { "city", profile.Location.City }, * { * "occupations", * profile.Schools != null && profile.Schools.Any() ? ( * profile.Jobs != null && profile.Jobs.Any() ? * profile.Schools.Select(s => s.Name).Concat(profile.Jobs.Select(j => j.Title + " - " + j.Company)).ToArrayString() : * profile.Schools.Select(s => s.Name).ToArrayString() * ) : ( * profile.Jobs != null && profile.Jobs.Any() ? * profile.Jobs.Select(j => j.Title + " - " + j.Company).ToArrayString() : * "" * ) * }, * { "name", profile.Name } * }.SaveDictAs(path + "insta_stalker_info.txt"); * else * new Dictionary<string, string>() * { * { "username", instagram.Username }, * { "media_count", instagram.AccountNumPhotos.ToString() }, * { "last_fetch_time", instagram.LastFetch.ToString() } * }.SaveDictAs(path + "insta_stalker_info.txt"); */ } }