public void UrlsLookupUserTest1() { FoundUser user = AuthInstance.UrlsLookupUser("https://www.flickr.com/photos/samjudson"); Assert.AreEqual("41888973@N00", user.UserId); Assert.AreEqual("Sam Judson", user.UserName); }
/// <summary> /// Finds the user id based upon username or email. Returns null if not found. /// </summary> /// <param name="userName"></param> /// <returns></returns> public FoundUser FindUserId(string userName) { FoundUser user = null; try { user = Service.PeopleFindByUsername(userName); } catch (FlickrNet.FlickrApiException ex1) { int code = ex1.Code; if (code == 1) { try { user = Service.PeopleFindByEmail(userName); } catch (FlickrNet.FlickrApiException ex2) { // Swallow and return null } } } return(user); }
public void Authenticate(FlickrAuthentication authentication) { Flickr = authentication.Authenticate(); User = Flickr.PeopleFindByUserName("me"); Authenticated = true; }
public FlickrClient(string apiKey, string sharedSecret, string token) { Flickr = new Flickr(apiKey, sharedSecret, token); User = Flickr.PeopleFindByUserName("me"); Authenticated = true; }
public void PeopleFindByEmail() { FoundUser user = AuthInstance.PeopleFindByEmail("*****@*****.**"); Assert.AreEqual("41888973@N00", user.UserId); Assert.AreEqual("Sam Judson", user.UserName); }
public void PeopleFindByUsername() { FoundUser user = AuthInstance.PeopleFindByUserName("Sam Judson"); Assert.AreEqual("Sam Judson", user.UserName); Assert.AreEqual("41888973@N00", user.UserId); }
public void PeopleFindByEmail() { Flickr f = TestData.GetAuthInstance(); FoundUser user = f.PeopleFindByEmail("*****@*****.**"); Assert.AreEqual("41888973@N00", user.UserId); Assert.AreEqual("Sam Judson", user.UserName); }
public PhotoCollection GetPhotoCollectionByName(string name) { FoundUser user = Flickr.PeopleFindByUserName(name); FlickrNet.PhotoSearchOptions options = new FlickrNet.PhotoSearchOptions(); options.UserId = user.UserId; options.PerPage = 20; options.Page = 1; return(Flickr.PhotosSearch(options)); }
// A region for simmiWorker #region // This method takes care of the process heavy stuff. It can report progress and I will use that // to load each image. private void simmiWorker_DoWork(object sender, DoWorkEventArgs e) { BackgroundWorker worker = sender as BackgroundWorker; Console.WriteLine("Async backgroundworker started"); if ((worker.CancellationPending == true)) { Console.WriteLine("if"); e.Cancel = true; // breaks out of the loop, if there is a loop. // break; } else { Flickr flickr = new Flickr("59c64644ddddc2a52a089131c8ca0933", "b080535e26aa05df"); FoundUser user = flickr.PeopleFindByUserName("simmisj"); //FoundUser user = flickr.PeopleFindByUserName("simmisj"); //PeoplePhotoCollection people = new PeoplePhotoCollection(); //people = flickr.PeopleGetPhotosOf(user.UserId); PhotoSearchOptions options = new PhotoSearchOptions(); options.UserId = user.UserId; // Your NSID options.PerPage = 4; // 100 is the default anyway PhotoCollection photos; try { photos = flickr.PhotosSearch(options); photos.Page = 1; } catch (Exception ea) { //e.Result = "Exception: " + ea; return; } for (int i = 0; i < photos.Count; i++) { // Report progress and pass the picture to the progresschanged method // for the progresschanged method to update the observablecollection. worker.ReportProgress(100, photos[i].Medium640Url); //pictures.Add(photos[i].Medium640Url); // Add the picture to the ObservableCollection. //pictures.Add(photos[i].Medium640Url); //scatterView1.Items.Add(photos[i].ThumbnailUrl); } } }
// Region fetching photos from Flickr from a specific account. #region public void fetchPhotosFromSpecifcUser(string userName) { Flickr flickr = new Flickr("59c64644ddddc2a52a089131c8ca0933", "b080535e26aa05df"); FoundUser user = flickr.PeopleFindByUserName(userName); //PeoplePhotoCollection people = new PeoplePhotoCollection(); //people = flickr.PeopleGetPhotosOf(user.UserId); PhotoSearchOptions options = new PhotoSearchOptions(); options.UserId = user.UserId; // Your NSID options.PerPage = 4; // 100 is the default anyway PhotoCollection photos = flickr.PhotosSearch(options); try { photos = flickr.PhotosSearch(options); photos.Page = 1; } catch (Exception ea) { //e.Result = "Exception: " + ea; return; } for (int i = 0; i < photos.Count; i++) { // Report progress and pass the picture to the progresschanged method // for the progresschanged method to update the observablecollection. pictures.Add(photos[i].Medium640Url); // Add the picture to the ObservableCollection. //pictures.Add(photos[i].Medium640Url); //scatterView1.Items.Add(photos[i].ThumbnailUrl); } }
protected void OnOpenUserProfile(FoundUser foundUser) { WaitOverlayProvider.ShowWaitOverlay(); EditUserId = foundUser; MyRegionManager.NavigateUsingViewModel <FoundUserProfileViewModel>(RegionNames.UsermanagementContentRegion); }