public PeopleGetPublicPhotos ( string userId ) : Photos | ||
userId | string | The user id of the user. |
return | Photos |
public Photos PeopleGetPublicPhotos(string userId)
{
Hashtable parameters = new Hashtable();
parameters.Add("method", "flickr.people.getPublicPhotos");
parameters.Add("api_key", _apiKey);
parameters.Add("user_id", userId);
FlickrNet.Response response = GetResponseCache(parameters);
if( response.Status == ResponseStatus.OK )
{
return response.Photos;
}
else
{
throw new FlickrException(response.Error);
}
}
public static List<Photo> GetPublicUserPhotos(string flickrUserId) { Flickr flickr = new Flickr(ConfigurationManager.AppSettings["apiKey"], ConfigurationManager.AppSettings["sharedSecret"]); const int photosPerPage = 500; //max allowed const int pageToReturn = 1; //first page return string.IsNullOrEmpty(flickrUserId) ? new List<Photo>() : flickr.PeopleGetPublicPhotos(flickrUserId, pageToReturn, photosPerPage, SafetyLevel.None, PhotoSearchExtras.Tags | PhotoSearchExtras.DateTaken).OrderByDescending(p => p.DateTaken).ToList(); }