public void ObtainSearchedPhotos(string path, string query) { for (int i = 1; i <= Number_Of_Pages; i++) { jog.PopulateListOfPhotoIDs(jog.GetMessage(GenerateTextSearchURL(query, i)).Result); foreach (string Photo_ID in jog.ListOfPhotoIDs) { string DownloadLink = jog.GetSizeDownload(jog.GetMessage(DownloaderClass.GenerateGetSizesAPI(Photo_ID)).Result); DownloaderClass.DownloadImage(DownloadLink, FormDownloadPath(path, Photo_ID)); } jog.FlushTheListOfIDs(); } }
public void ObtainUserPublicPhotos(string User_URL, string Download_Location) { for (int i = 1; i <= Number_Of_Pages; i++) { jog.PopulateListOfPhotoIDs(jog.GetMessage(GenerateUserPublicPhotosURL(User_URL, i)).Result); foreach (string Photo_ID in jog.ListOfPhotoIDs) { string DownloadLink = jog.GetSizeDownload(jog.GetMessage(DownloaderClass.GenerateGetSizesAPI(Photo_ID)).Result); DownloaderClass.DownloadImage(DownloadLink, FormDownloadPath(Download_Location, Photo_ID)); } jog.FlushTheListOfIDs(); } }
public void ObtainSearchedPhotos(string path, string query) { Thread t = new Thread(() => { for (int i = 1; i <= Number_Of_Pages; i++) { Console.WriteLine(i); jog.PopulateListOfPhotoIDs(jog.GetMessage(GenerateTextSearchURL(query, i)).Result); foreach (string Photo_ID in jog.ListOfPhotoIDs) { string DownloadLink = jog.GetSizeDownload(jog.GetMessage(DownloaderClass.GenerateGetSizesAPI(Photo_ID)).Result); DownloaderClass.DownloadImage(DownloadLink, FormDownloadPath(path, Photo_ID)); } jog.FlushTheListOfIDs(); } Console.WriteLine("Download Complete"); }); t.Start(); }