/// <summary> /// Returns the first 24 photos for a given tag cluster. /// </summary> /// <param name="tag">The tag whose cluster photos you want to return.</param> /// <param name="clusterId">The cluster id for the cluster you want to return the photos. This is the first three subtags of the tag cluster appended with hyphens ('-').</param> /// <param name="extras">Extra information to return with each photo.</param> /// <returns></returns> public PhotoCollection TagsGetClusterPhotos(string tag, string clusterId, PhotoSearchExtras extras) { Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.tags.getClusterPhotos"); parameters.Add("tag", tag); parameters.Add("cluster_id", clusterId); if (extras != PhotoSearchExtras.None) parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); return GetResponseCache<PhotoCollection>(parameters); }
/// <summary> /// Returns the first 24 photos for a given tag cluster. /// </summary> /// <param name="tag">The tag whose cluster photos you want to return.</param> /// <param name="clusterId">The cluster id for the cluster you want to return the photos. This is the first three subtags of the tag cluster appended with hyphens ('-').</param> /// <param name="extras">Extra information to return with each photo.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void TagsGetClusterPhotosAsync(string tag, string clusterId, PhotoSearchExtras extras, Action<FlickrResult<PhotoCollection>> callback) { Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.tags.getClusterPhotos"); parameters.Add("tag", tag); parameters.Add("cluster_id", clusterId); if (extras != PhotoSearchExtras.None) parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); GetResponseAsync<PhotoCollection>(parameters, callback); }
/// <summary> /// Gets a list of photos for the given panda. /// </summary> /// <param name="pandaName">The name of the panda to return photos for.</param> /// <param name="extras">The extras to return with the photos.</param> /// <param name="perPage">The number of photos to return per page.</param> /// <param name="page">The age to return.</param> /// <returns>A list of photos for the panda.</returns> public PandaPhotoCollection PandaGetPhotos(string pandaName, PhotoSearchExtras extras, int page, int perPage) { Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.panda.getPhotos"); parameters.Add("panda_name", pandaName); if (extras != PhotoSearchExtras.None) parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); if (perPage > 0) parameters.Add("per_page", perPage.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (page > 0) parameters.Add("page", page.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); return GetResponseCache<PandaPhotoCollection>(parameters); }
/// <summary> /// Gets a list of photos for the given panda. /// </summary> /// <param name="pandaName">The name of the panda to return photos for.</param> /// <param name="extras">The extras to return with the photos.</param> /// <param name="perPage">The number of photos to return per page.</param> /// <param name="page">The age to return.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PandaGetPhotosAsync(string pandaName, PhotoSearchExtras extras, int page, int perPage, Action<FlickrResult<PandaPhotoCollection>> callback) { Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.panda.getPhotos"); parameters.Add("panda_name", pandaName); if (extras != PhotoSearchExtras.None) parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); if (perPage > 0) parameters.Add("per_page", perPage.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (page > 0) parameters.Add("page", page.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); GetResponseAsync<PandaPhotoCollection>(parameters, callback); }
/// <summary> /// Get the next and previous favorites in a users list of favorites, based on one of their favorites. /// </summary> /// <param name="photoId">The photo id of the photo for which to find the next and previous favorites.</param> /// <param name="userId">The user id of the users whose favorites you wish to search.</param> /// <param name="numPrevious">The number of previous favorites to list. Defaults to 1.</param> /// <param name="numNext">The number of next favorites to list. Defaults to 1.</param> /// <param name="extras">Any extras to return for each photo in the previous and next list.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> /// <returns></returns> public void FavoritesGetContextAsync(string photoId, string userId, int numPrevious, int numNext, PhotoSearchExtras extras, Action<FlickrResult<FavoriteContext>> callback) { var parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.favorites.getContext"); parameters.Add("user_id", userId); parameters.Add("photo_id", photoId); parameters.Add("num_prev", Math.Max(1, numPrevious).ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("num_next", Math.Max(1, numNext).ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (extras != PhotoSearchExtras.None) parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); GetResponseAsync<FavoriteContext>(parameters, callback); }
/// <summary> /// Get the next and previous favorites in a users list of favorites, based on one of their favorites. /// </summary> /// <param name="photoId">The photo id of the photo for which to find the next and previous favorites.</param> /// <param name="userId">The user id of the users whose favorites you wish to search.</param> /// <param name="numPrevious">The number of previous favorites to list. Defaults to 1.</param> /// <param name="numNext">The number of next favorites to list. Defaults to 1.</param> /// <param name="extras">Any extras to return for each photo in the previous and next list.</param> /// <returns></returns> public FavoriteContext FavoritesGetContext(string photoId, string userId, int numPrevious, int numNext, PhotoSearchExtras extras) { Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.favorites.getContext"); parameters.Add("user_id", userId); parameters.Add("photo_id", photoId); parameters.Add("num_prev", Math.Max(1, numPrevious).ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("num_next", Math.Max(1, numNext).ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (extras != PhotoSearchExtras.None) parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); return GetResponseCache<FavoriteContext>(parameters); }
/// <summary> /// Gets a list of photos from the most recent interstingness list. /// </summary> /// <param name="date">The date to return the interestingness photos for.</param> /// <param name="extras">The extra parameters to return along with the search results. /// See <see cref="PhotoSearchOptions"/> for more details.</param> /// <param name="perPage">The number of results to return per page.</param> /// <param name="page">The page of the results to return.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void InterestingnessGetListAsync(DateTime date, PhotoSearchExtras extras, int page, int perPage, Action<FlickrResult<PhotoCollection>> callback) { var parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.interestingness.getList"); if (date > DateTime.MinValue) parameters.Add("date", date.ToString("yyyy-MM-dd", System.Globalization.DateTimeFormatInfo.InvariantInfo)); if (perPage > 0) parameters.Add("per_page", perPage.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (page > 0) parameters.Add("page", page.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (extras != PhotoSearchExtras.None) parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); GetResponseAsync<PhotoCollection>(parameters, callback); }
/// <summary> /// Gets a list of photos from the most recent interstingness list. /// </summary> /// <param name="date">The date to return the interestingness photos for.</param> /// <param name="extras">The extra parameters to return along with the search results. /// See <see cref="PhotoSearchOptions"/> for more details.</param> /// <param name="perPage">The number of results to return per page.</param> /// <param name="page">The page of the results to return.</param> /// <returns></returns> public PhotoCollection InterestingnessGetList(DateTime date, PhotoSearchExtras extras, int page, int perPage) { Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.interestingness.getList"); if (date > DateTime.MinValue) parameters.Add("date", date.ToString("yyyy-MM-dd", System.Globalization.DateTimeFormatInfo.InvariantInfo)); if (perPage > 0) parameters.Add("per_page", perPage.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (page > 0) parameters.Add("page", page.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (extras != PhotoSearchExtras.None) parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); return GetResponseCache<PhotoCollection>(parameters); }
/// <summary> /// Utility method to convert the <see cref="PhotoSearchExtras"/> enum to a string. /// </summary> /// <example> /// <code> /// PhotoSearchExtras extras = PhotoSearchExtras.DateTaken & PhotoSearchExtras.IconServer; /// string val = Utils.ExtrasToString(extras); /// Console.WriteLine(val); /// </code> /// outputs: "date_taken,icon_server"; /// </example> /// <param name="extras"></param> /// <returns></returns> public static string ExtrasToString(PhotoSearchExtras extras) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); if( (extras & PhotoSearchExtras.DateTaken) == PhotoSearchExtras.DateTaken ) sb.Append("date_taken"); if( (extras & PhotoSearchExtras.DateUploaded) == PhotoSearchExtras.DateUploaded ) { if( sb.Length>0 ) sb.Append(","); sb.Append("date_upload"); } if( (extras & PhotoSearchExtras.IconServer) == PhotoSearchExtras.IconServer ) { if( sb.Length>0 ) sb.Append(","); sb.Append("icon_server"); } if( (extras & PhotoSearchExtras.License) == PhotoSearchExtras.License ) { if( sb.Length>0 ) sb.Append(","); sb.Append("license"); } if( (extras & PhotoSearchExtras.OwnerName) == PhotoSearchExtras.OwnerName ) { if( sb.Length>0 ) sb.Append(","); sb.Append("owner_name"); } if( (extras & PhotoSearchExtras.OriginalFormat) == PhotoSearchExtras.OriginalFormat ) { if( sb.Length>0 ) sb.Append(","); sb.Append("original_format"); } if( (extras & PhotoSearchExtras.LastUpdated) == PhotoSearchExtras.LastUpdated ) { if( sb.Length>0 ) sb.Append(","); sb.Append("last_update"); } if( (extras & PhotoSearchExtras.Tags) == PhotoSearchExtras.Tags ) { if( sb.Length>0 ) sb.Append(","); sb.Append("tags"); } if( (extras & PhotoSearchExtras.Geo) == PhotoSearchExtras.Geo ) { if( sb.Length>0 ) sb.Append(","); sb.Append("geo"); } return sb.ToString(); }
/// <summary> /// Gets a list of a users photos which are not in a set. /// </summary> /// <param name="perPage">Number of photos per page.</param> /// <param name="page">The page number to return.</param> /// <param name="extras"><see cref="PhotoSearchExtras"/> enumeration.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PhotosGetNotInSetAsync(int page, int perPage, PhotoSearchExtras extras, Action<FlickrResult<PhotoCollection>> callback) { PartialSearchOptions options = new PartialSearchOptions(); options.PerPage = perPage; options.Page = page; options.Extras = extras; PhotosGetNotInSetAsync(options, callback); }
/// <summary> /// Returns a list of your photos with no tags. /// </summary> /// <param name="extras">A comma-delimited list of extra information to fetch for each returned record.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PhotosGetUntaggedAsync(PhotoSearchExtras extras, Action<FlickrResult<PhotoCollection>> callback) { PhotosGetUntaggedAsync(0, 0, extras, callback); }
/// <summary> /// Gets a users public photos. Excludes private photos. /// </summary> /// <param name="userId">The user id of the user.</param> /// <param name="extras">Which (if any) extra information to return. The default is none.</param> /// <returns>The collection of photos contained within a <see cref="Photo"/> object.</returns> public PhotoCollection PeopleGetPublicPhotos(string userId, PhotoSearchExtras extras) { return(PeopleGetPublicPhotos(userId, 0, 0, SafetyLevel.None, extras)); }
/// <summary> /// Gets the public photos for given users ID's contacts. /// </summary> /// <param name="userId">The user ID whose contacts you wish to get photos for.</param> /// <param name="count">The number of photos to return. Defaults to 10, maximum is 50.</param> /// <param name="extras">A list of extra details to return for each photo.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PhotosGetContactsPublicPhotosAsync(string userId, int count, PhotoSearchExtras extras, Action<FlickrResult<PhotoCollection>> callback) { PhotosGetContactsPublicPhotosAsync(userId, count, false, false, false, extras, callback); }
/// <summary> /// Get a list of favourites for the specified user. /// </summary> /// <param name="userId">The user id of the user whose favourites you wish to retrieve.</param> /// <param name="extras">The extras to return for each photo.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void FavoritesGetListAsync(string userId, PhotoSearchExtras extras, Action <FlickrResult <PhotoCollection> > callback) { FavoritesGetListAsync(userId, DateTime.MinValue, DateTime.MinValue, extras, 0, 0, callback); }
/// <summary> /// Return the list of photos belonging to your contacts that have been commented on recently. /// </summary> /// <param name="dateLastComment">Limits the resultset to photos that have been commented on since this date. The default, and maximum, offset is (1) hour.</param> /// <param name="extras"></param> /// <param name="page">The page of results to return. If this argument is omitted, it defaults to 1.</param> /// <param name="perPage">Number of photos to return per page. If this argument is omitted, it defaults to 100. The maximum allowed value is 500.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PhotosCommentsGetRecentForContactsAsync(DateTime dateLastComment, PhotoSearchExtras extras, int page, int perPage, Action<FlickrResult<PhotoCollection>> callback) { PhotosCommentsGetRecentForContactsAsync(dateLastComment, null, extras, page, perPage, callback); }
/// <summary> /// Gets a collection of photos for a photoset. /// </summary> /// <param name="photosetId">The ID of the photoset to return photos for.</param> /// <param name="extras">The extras to return for each photo.</param> /// <param name="privacyFilter">The privacy filter to search on.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PhotosetsGetPhotosAsync(string photosetId, PhotoSearchExtras extras, PrivacyFilter privacyFilter, Action <FlickrResult <PhotosetPhotoCollection> > callback) { PhotosetsGetPhotosAsync(photosetId, extras, privacyFilter, 0, 0, callback); }
/// <summary> /// Gets a list of photos for a given group. /// </summary> /// <param name="groupId">The group ID for the group.</param> /// <param name="tags">Space seperated list of tags that photos returned must have. /// Currently only supports 1 tag at a time.</param> /// <param name="userId">The group member to return photos for.</param> /// <param name="extras">The <see cref="PhotoSearchExtras"/> specifying which extras to return. All other overloads default to returning all extras.</param> /// <param name="perPage">The number of photos per page.</param> /// <param name="page">The page to return.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void GroupsPoolsGetPhotosAsync(string groupId, string tags, string userId, PhotoSearchExtras extras, int page, int perPage, Action <FlickrResult <PhotoCollection> > callback) { Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("method", "flickr.groups.pools.getPhotos"); parameters.Add("group_id", groupId); if (tags != null && tags.Length > 0) { parameters.Add("tags", tags); } if (page > 0) { parameters.Add("page", page.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); } if (perPage > 0) { parameters.Add("per_page", perPage.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); } if (userId != null && userId.Length > 0) { parameters.Add("user_id", userId); } if (extras != PhotoSearchExtras.None) { parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); } GetResponseAsync <PhotoCollection>(parameters, callback); }
/// <summary> /// Return photos from the given user's photostream. Only photos visible to the calling user will be returned. This method must be authenticated; /// </summary> /// <param name="userId">The NSID of the user who's photos to return. A value of "me" will return the calling user's photos.</param> /// <param name="safeSearch">Safe search setting</param> /// <param name="minUploadDate">Minimum upload date. Photos with an upload date greater than or equal to this value will be returned.</param> /// <param name="maxUploadDate">Maximum upload date. Photos with an upload date less than or equal to this value will be returned.</param> /// <param name="minTakenDate">Minimum taken date. Photos with an taken date greater than or equal to this value will be returned. </param> /// <param name="maxTakenDate">Maximum taken date. Photos with an taken date less than or equal to this value will be returned. </param> /// <param name="contentType">Content Type setting</param> /// <param name="privacyFilter">Return photos only matching a certain privacy level.</param> /// <param name="extras">A list of extra information to fetch for each returned record.</param> /// <param name="page">The page of results to return. If this argument is omitted, it defaults to 1.</param> /// <param name="perPage">Number of photos to return per page. If this argument is omitted, it defaults to 100. The maximum allowed value is 500.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PeopleGetPhotosAsync(string userId, SafetyLevel safeSearch, DateTime minUploadDate, DateTime maxUploadDate, DateTime minTakenDate, DateTime maxTakenDate, ContentTypeSearch contentType, PrivacyFilter privacyFilter, PhotoSearchExtras extras, int page, int perPage, Action <FlickrResult <PhotoCollection> > callback) { CheckRequiresAuthentication(); Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("method", "flickr.people.getPhotos"); parameters.Add("user_id", userId ?? "me"); if (safeSearch != SafetyLevel.None) { parameters.Add("safe_search", safeSearch.ToString("d")); } if (minUploadDate != DateTime.MinValue) { parameters.Add("min_upload_date", UtilityMethods.DateToUnixTimestamp(minUploadDate)); } if (maxUploadDate != DateTime.MinValue) { parameters.Add("max_upload_date", UtilityMethods.DateToUnixTimestamp(maxUploadDate)); } if (minTakenDate != DateTime.MinValue) { parameters.Add("min_taken_date", UtilityMethods.DateToMySql(minTakenDate)); } if (maxTakenDate != DateTime.MinValue) { parameters.Add("max_taken_date", UtilityMethods.DateToMySql(maxTakenDate)); } if (contentType != ContentTypeSearch.None) { parameters.Add("content_type", contentType.ToString("d")); } if (privacyFilter != PrivacyFilter.None) { parameters.Add("privacy_filter", privacyFilter.ToString("d")); } if (extras != PhotoSearchExtras.None) { parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); } if (page > 0) { parameters.Add("page", page.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); } if (perPage > 0) { parameters.Add("per_page", perPage.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); } GetResponseAsync <PhotoCollection>(parameters, callback); }
/// <summary> /// Gets the photos containing the specified user. /// </summary> /// <param name="userId">The user ID to get photos of.</param> /// <param name="extras">A list of extras to return for each photo.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PeopleGetPhotosOfAsync(string userId, PhotoSearchExtras extras, Action <FlickrResult <PeoplePhotoCollection> > callback) { PeopleGetPhotosOfAsync(userId, extras, 0, 0, callback); }
/// <summary> /// Return photos from the given user's photostream. Only photos visible to the calling user will be returned. This method must be authenticated; /// </summary> /// <param name="userId">The NSID of the user who's photos to return. A value of "me" will return the calling user's photos.</param> /// <param name="extras">A list of extra information to fetch for each returned record.</param> /// <param name="page">The page of results to return. If this argument is omitted, it defaults to 1.</param> /// <param name="perPage">Number of photos to return per page. If this argument is omitted, it defaults to 100. The maximum allowed value is 500.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PeopleGetPhotosAsync(string userId, PhotoSearchExtras extras, int page, int perPage, Action <FlickrResult <PhotoCollection> > callback) { PeopleGetPhotosAsync(userId, SafetyLevel.None, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, ContentTypeSearch.None, PrivacyFilter.None, extras, page, perPage, callback); }
/// <summary> /// Return photos from the calling user's photostream. This method must be authenticated; /// </summary> /// <param name="extras">A list of extra information to fetch for each returned record.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PeopleGetPhotosAsync(PhotoSearchExtras extras, Action <FlickrResult <PhotoCollection> > callback) { PeopleGetPhotosAsync(null, SafetyLevel.None, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, ContentTypeSearch.None, PrivacyFilter.None, extras, 0, 0, callback); }
/// <summary> /// Gets a users public photos. Excludes private photos. /// </summary> /// <param name="userId">The user id of the user.</param> /// <param name="page">The page to return. Defaults to page 1.</param> /// <param name="perPage">The number of photos to return per page. Default is 100.</param> /// <param name="extras">Which (if any) extra information to return. The default is none.</param> /// <param name="safetyLevel">The safety level of the returned photos. /// Unauthenticated calls can only return Safe photos.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PeopleGetPublicPhotosAsync(string userId, int page, int perPage, SafetyLevel safetyLevel, PhotoSearchExtras extras, Action <FlickrResult <PhotoCollection> > callback) { if (!IsAuthenticated && safetyLevel > SafetyLevel.Safe) { throw new ArgumentException("Safety level may only be 'Safe' for unauthenticated calls", "safetyLevel"); } Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("method", "flickr.people.getPublicPhotos"); parameters.Add("api_key", apiKey); parameters.Add("user_id", userId); if (perPage > 0) { parameters.Add("per_page", perPage.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); } if (page > 0) { parameters.Add("page", page.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); } if (safetyLevel != SafetyLevel.None) { parameters.Add("safety_level", safetyLevel.ToString("D")); } if (extras != PhotoSearchExtras.None) { parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); } GetResponseAsync <PhotoCollection>(parameters, callback); }
/// <summary> /// Return a list of your photos that have been recently created or which have been recently modified. /// Recently modified may mean that the photo's metadata (title, description, tags) /// may have been changed or a comment has been added (or just modified somehow :-) /// </summary> /// <param name="minDate">The date from which modifications should be compared.</param> /// <param name="extras">A list of extra information to fetch for each returned record.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PhotosRecentlyUpdatedAsync(DateTime minDate, PhotoSearchExtras extras, Action<FlickrResult<PhotoCollection>> callback) { PhotosRecentlyUpdatedAsync(minDate, extras, 0, 0, callback); }
/// <summary> /// Gets a collection of photos for a photoset. /// </summary> /// <param name="photosetId">The ID of the photoset to return photos for.</param> /// <param name="extras">The extras to return for each photo.</param> /// <param name="privacyFilter">The privacy filter to search on.</param> /// <param name="page">The page to return, defaults to 1.</param> /// <param name="perPage">The number of photos to return per page.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PhotosetsGetPhotosAsync(string photosetId, PhotoSearchExtras extras, PrivacyFilter privacyFilter, int page, int perPage, Action <FlickrResult <PhotosetPhotoCollection> > callback) { PhotosetsGetPhotosAsync(photosetId, extras, privacyFilter, page, perPage, MediaType.None, callback); }
/// <summary> /// Gets a list of photos from the most recent interstingness list. /// </summary> /// <param name="perPage">Number of photos per page.</param> /// <param name="page">The page number to return.</param> /// <param name="extras"><see cref="PhotoSearchExtras"/> enumeration.</param> /// <returns><see cref="PhotoCollection"/> instance containing list of photos.</returns> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void InterestingnessGetListAsync(PhotoSearchExtras extras, int page, int perPage, Action<FlickrResult<PhotoCollection>> callback) { InterestingnessGetListAsync(DateTime.MinValue, extras, page, perPage, callback); }
/// <summary> /// Utility method to convert the <see cref="PhotoSearchExtras"/> enum to a string. /// </summary> /// <example> /// <code> /// PhotoSearchExtras extras = PhotoSearchExtras.DateTaken & PhotoSearchExtras.IconServer; /// string val = Utils.ExtrasToString(extras); /// Console.WriteLine(val); /// </code> /// outputs: "date_taken,icon_server"; /// </example> /// <param name="extras"></param> /// <returns></returns> internal static string ExtrasToString(PhotoSearchExtras extras) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); if ((extras & PhotoSearchExtras.DateTaken) == PhotoSearchExtras.DateTaken) { sb.Append("date_taken"); } if ((extras & PhotoSearchExtras.DateUploaded) == PhotoSearchExtras.DateUploaded) { if (sb.Length > 0) { sb.Append(","); } sb.Append("date_upload"); } if ((extras & PhotoSearchExtras.IconServer) == PhotoSearchExtras.IconServer) { if (sb.Length > 0) { sb.Append(","); } sb.Append("icon_server"); } if ((extras & PhotoSearchExtras.License) == PhotoSearchExtras.License) { if (sb.Length > 0) { sb.Append(","); } sb.Append("license"); } if ((extras & PhotoSearchExtras.OwnerName) == PhotoSearchExtras.OwnerName) { if (sb.Length > 0) { sb.Append(","); } sb.Append("owner_name"); } if ((extras & PhotoSearchExtras.OriginalFormat) == PhotoSearchExtras.OriginalFormat) { if (sb.Length > 0) { sb.Append(","); } sb.Append("original_format"); } if ((extras & PhotoSearchExtras.LastUpdated) == PhotoSearchExtras.LastUpdated) { if (sb.Length > 0) { sb.Append(","); } sb.Append("last_update"); } if ((extras & PhotoSearchExtras.Tags) == PhotoSearchExtras.Tags) { if (sb.Length > 0) { sb.Append(","); } sb.Append("tags"); } if ((extras & PhotoSearchExtras.Geo) == PhotoSearchExtras.Geo) { if (sb.Length > 0) { sb.Append(","); } sb.Append("geo"); } return(sb.ToString()); }
/// <summary> /// Returns the first 24 photos for a given tag cluster. /// </summary> /// <param name="cluster">The <see cref="Cluster"/> instance to return the photos for.</param> /// <param name="extras">Extra information to return with each photo.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void TagsGetClusterPhotosAsync(Cluster cluster, PhotoSearchExtras extras, Action<FlickrResult<PhotoCollection>> callback) { TagsGetClusterPhotosAsync(cluster.SourceTag, cluster.ClusterId, extras, callback); }
/// <summary> /// Gets a collection of photos for a photoset. /// </summary> /// <param name="photosetId">The ID of the photoset to return photos for.</param> /// <param name="extras">The extras to return for each photo.</param> /// <param name="privacyFilter">The privacy filter to search on.</param> /// <returns>A <see cref="PhotosetPhotoCollection"/> object containing the list of <see cref="Photo"/> instances.</returns> public PhotosetPhotoCollection PhotosetsGetPhotos(string photosetId, PhotoSearchExtras extras, PrivacyFilter privacyFilter) { return PhotosetsGetPhotos(photosetId, extras, privacyFilter, 0, 0); }
/// <summary> /// Gets a list of photos for a given group. /// </summary> /// <param name="groupId">The group ID for the group.</param> /// <param name="tags">Space seperated list of tags that photos returned must have. /// Currently only supports 1 tag at a time.</param> /// <param name="userId">The group member to return photos for.</param> /// <param name="extras">The <see cref="PhotoSearchExtras"/> specifying which extras to return. All other overloads default to returning all extras.</param> /// <param name="perPage">The number of photos per page.</param> /// <param name="page">The page to return.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void GroupsPoolsGetPhotosAsync(string groupId, string tags, string userId, PhotoSearchExtras extras, int page, int perPage, Action<FlickrResult<PhotoCollection>> callback) { Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.groups.pools.getPhotos"); parameters.Add("group_id", groupId); if (tags != null && tags.Length > 0) parameters.Add("tags", tags); if (page > 0) parameters.Add("page", page.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (perPage > 0) parameters.Add("per_page", perPage.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (userId != null && userId.Length > 0) parameters.Add("user_id", userId); if (extras != PhotoSearchExtras.None) parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); GetResponseAsync<PhotoCollection>(parameters, callback); }
/// <summary> /// Gets a collection of photos for a photoset. /// </summary> /// <param name="photosetId">The ID of the photoset to return photos for.</param> /// <param name="extras">The extras to return for each photo.</param> /// <param name="privacyFilter">The privacy filter to search on.</param> /// <param name="page">The page to return, defaults to 1.</param> /// <param name="perPage">The number of photos to return per page.</param> /// <param name="media">Filter on the type of media.</param> /// <returns>An array of <see cref="Photo"/> instances.</returns> public PhotosetPhotoCollection PhotosetsGetPhotos(string photosetId, PhotoSearchExtras extras, PrivacyFilter privacyFilter, int page, int perPage, MediaType media) { Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.photosets.getPhotos"); parameters.Add("photoset_id", photosetId); if (extras != PhotoSearchExtras.None) parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); if (privacyFilter != PrivacyFilter.None) parameters.Add("privacy_filter", privacyFilter.ToString("d")); if (page > 0) parameters.Add("page", page.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (perPage > 0) parameters.Add("per_page", perPage.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (media != MediaType.None) parameters.Add("media", (media == MediaType.All ? "all" : (media == MediaType.Photos ? "photos" : (media == MediaType.Videos ? "videos" : String.Empty)))); return GetResponseCache<PhotosetPhotoCollection>(parameters); }
/// <summary> /// Return the list of photos belonging to your contacts that have been commented on recently. /// </summary> /// <param name="dateLastComment">Limits the resultset to photos that have been commented on since this date. The default, and maximum, offset is (1) hour.</param> /// <param name="contactsFilter">A list of contact NSIDs to limit the scope of the query to.</param> /// <param name="extras"></param> /// <param name="page">The page of results to return. If this argument is omitted, it defaults to 1.</param> /// <param name="perPage">Number of photos to return per page. If this argument is omitted, it defaults to 100. The maximum allowed value is 500.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PhotosCommentsGetRecentForContactsAsync(DateTime dateLastComment, string[] contactsFilter, PhotoSearchExtras extras, int page, int perPage, Action<FlickrResult<PhotoCollection>> callback) { CheckRequiresAuthentication(); Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.photos.comments.getRecentForContacts"); if (dateLastComment != DateTime.MinValue) parameters.Add("date_lastcomment", UtilityMethods.DateToUnixTimestamp(dateLastComment)); if (contactsFilter != null && contactsFilter.Length > 0) parameters.Add("contacts_filter", String.Join(",", contactsFilter)); if (extras != PhotoSearchExtras.None) parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); if (page > 0) parameters.Add("page", page.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (perPage > 0) parameters.Add("per_page", perPage.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); GetResponseAsync<PhotoCollection>(parameters, callback); }
/// <summary> /// Gets a list of photos from the most recent interstingness list. /// </summary> /// <param name="perPage">Number of photos per page.</param> /// <param name="page">The page number to return.</param> /// <param name="extras"><see cref="PhotoSearchExtras"/> enumeration.</param> /// <returns><see cref="PhotoCollection"/> instance containing list of photos.</returns> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void InterestingnessGetListAsync(PhotoSearchExtras extras, int page, int perPage, Action <FlickrResult <PhotoCollection> > callback) { InterestingnessGetListAsync(DateTime.MinValue, extras, page, perPage, callback); }
/// <summary> /// Gets a collection of photos for a photoset. /// </summary> /// <param name="photosetId">The ID of the photoset to return photos for.</param> /// <param name="extras">The extras to return for each photo.</param> /// <param name="privacyFilter">The privacy filter to search on.</param> /// <param name="page">The page to return, defaults to 1.</param> /// <param name="perPage">The number of photos to return per page.</param> /// <returns>An array of <see cref="Photo"/> instances.</returns> public PhotosetPhotoCollection PhotosetsGetPhotos(string photosetId, PhotoSearchExtras extras, PrivacyFilter privacyFilter, int page, int perPage) { return PhotosetsGetPhotos(photosetId, extras, privacyFilter, page, perPage, MediaType.None); }
/// <summary> /// Get a list of the currently logger in users favourites. /// Requires authentication. /// </summary> /// <param name="extras">The extras to return for each photo.</param> /// <param name="perPage">Number of photos to include per page.</param> /// <param name="page">The page to download this time.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void FavoritesGetListAsync(PhotoSearchExtras extras, int page, int perPage, Action <FlickrResult <PhotoCollection> > callback) { FavoritesGetListAsync(null, DateTime.MinValue, DateTime.MinValue, extras, page, perPage, callback); }
/// <summary> /// Gets your contacts most recent photos. /// </summary> /// <param name="count">The number of photos to return, from between 10 and 50.</param> /// <param name="justFriends">If true only returns photos from contacts marked as /// 'friends'.</param> /// <param name="singlePhoto">If true only returns a single photo for each of your contacts. /// Ignores the count if this is true.</param> /// <param name="includeSelf">If true includes yourself in the group of people to /// return photos for.</param> /// <param name="extras">Optional extras that can be returned by this call.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> /// <exception cref="ArgumentOutOfRangeException"> /// Throws a <see cref="ArgumentOutOfRangeException"/> exception if the cound /// is not between 10 and 50, or 0.</exception> public void PhotosGetContactsPhotosAsync(int count, bool justFriends, bool singlePhoto, bool includeSelf, PhotoSearchExtras extras, Action<FlickrResult<PhotoCollection>> callback) { CheckRequiresAuthentication(); if (count != 0 && (count < 10 || count > 50) && !singlePhoto) { throw new ArgumentOutOfRangeException("count", String.Format(System.Globalization.CultureInfo.InvariantCulture, "Count must be between 10 and 50. ({0})", count)); } Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.photos.getContactsPhotos"); if (count > 0 && !singlePhoto) parameters.Add("count", count.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (justFriends) parameters.Add("just_friends", "1"); if (singlePhoto) parameters.Add("single_photo", "1"); if (includeSelf) parameters.Add("include_self", "1"); if (extras != PhotoSearchExtras.None) parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); GetResponseAsync<PhotoCollection>(parameters, callback); }
/// <summary> /// Get the next and previous favorites in a users list of favorites, based on one of their favorites. /// </summary> /// <param name="photoId">The photo id of the photo for which to find the next and previous favorites.</param> /// <param name="userId">The user id of the users whose favorites you wish to search.</param> /// <param name="numPrevious">The number of previous favorites to list. Defaults to 1.</param> /// <param name="numNext">The number of next favorites to list. Defaults to 1.</param> /// <param name="extras">Any extras to return for each photo in the previous and next list.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> /// <returns></returns> public void FavoritesGetContextAsync(string photoId, string userId, int numPrevious, int numNext, PhotoSearchExtras extras, Action <FlickrResult <FavoriteContext> > callback) { var parameters = new Dictionary <string, string>(); parameters.Add("method", "flickr.favorites.getContext"); parameters.Add("user_id", userId); parameters.Add("photo_id", photoId); parameters.Add("num_prev", Math.Max(1, numPrevious).ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("num_next", Math.Max(1, numNext).ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (extras != PhotoSearchExtras.None) { parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); } GetResponseAsync <FavoriteContext>(parameters, callback); }
/// <summary> /// Gets the public photos for given users ID's contacts. /// </summary> /// <param name="userId">The user ID whose contacts you wish to get photos for.</param> /// <param name="count">The number of photos to return. Defaults to 10, maximum is 50.</param> /// <param name="justFriends">True to just return photos from friends and family (excluding regular contacts).</param> /// <param name="singlePhoto">True to return just a single photo for each contact.</param> /// <param name="includeSelf">True to include photos from the user ID specified as well.</param> /// <param name="extras">A list of extra details to return for each photo.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PhotosGetContactsPublicPhotosAsync(string userId, int count, bool justFriends, bool singlePhoto, bool includeSelf, PhotoSearchExtras extras, Action<FlickrResult<PhotoCollection>> callback) { Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.photos.getContactsPublicPhotos"); parameters.Add("api_key", apiKey); parameters.Add("user_id", userId); if (count > 0) parameters.Add("count", count.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (justFriends) parameters.Add("just_friends", "1"); if (singlePhoto) parameters.Add("single_photo", "1"); if (includeSelf) parameters.Add("include_self", "1"); if (extras != PhotoSearchExtras.None) parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); GetResponseAsync<PhotoCollection>(parameters, callback); }
/// <summary> /// Get the next and previous favorites in a users list of favorites, based on one of their favorites. /// </summary> /// <param name="photoId">The photo id of the photo for which to find the next and previous favorites.</param> /// <param name="userId">The user id of the users whose favorites you wish to search.</param> /// <param name="extras">Any extras to return for each photo in the previous and next list.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> /// <returns></returns> public void FavoritesGetContextAsync(string photoId, string userId, PhotoSearchExtras extras, Action <FlickrResult <FavoriteContext> > callback) { FavoritesGetContextAsync(photoId, userId, 1, 1, extras, callback); }
/// <summary> /// Returns a list of the latest public photos uploaded to flickr. /// </summary> /// <param name="extras">A comma-delimited list of extra information to fetch for each returned record.</param> /// <param name="page">The page of results to return. If this argument is omitted, it defaults to 1.</param> /// <param name="perPage">Number of photos to return per page. If this argument is omitted, it defaults to 100. The maximum allowed value is 500.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PhotosGetRecentAsync(int page, int perPage, PhotoSearchExtras extras, Action<FlickrResult<PhotoCollection>> callback) { Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.photos.getRecent"); parameters.Add("api_key", apiKey); if (perPage > 0) parameters.Add("per_page", perPage.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (page > 0) parameters.Add("page", page.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (extras != PhotoSearchExtras.None) parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); GetResponseAsync<PhotoCollection>(parameters, callback); }
/// <summary> /// Utility method to convert the <see cref="PhotoSearchExtras"/> enum to a string. /// </summary> /// <example> /// <code> /// PhotoSearchExtras extras = PhotoSearchExtras.DateTaken & PhotoSearchExtras.IconServer; /// string val = Utils.ExtrasToString(extras); /// Console.WriteLine(val); /// </code> /// outputs: "date_taken,icon_server"; /// </example> /// <param name="extras"></param> /// <returns></returns> public static string ExtrasToString(PhotoSearchExtras extras) { List<string> extraList = new List<string>(); if ((extras & PhotoSearchExtras.DateTaken) == PhotoSearchExtras.DateTaken) extraList.Add("date_taken"); if ((extras & PhotoSearchExtras.DateUploaded) == PhotoSearchExtras.DateUploaded) extraList.Add("date_upload"); if ((extras & PhotoSearchExtras.IconServer) == PhotoSearchExtras.IconServer) extraList.Add("icon_server"); if ((extras & PhotoSearchExtras.License) == PhotoSearchExtras.License) extraList.Add("license"); if ((extras & PhotoSearchExtras.OwnerName) == PhotoSearchExtras.OwnerName) extraList.Add("owner_name"); if ((extras & PhotoSearchExtras.OriginalFormat) == PhotoSearchExtras.OriginalFormat) extraList.Add("original_format"); if ((extras & PhotoSearchExtras.LastUpdated) == PhotoSearchExtras.LastUpdated) extraList.Add("last_update"); if ((extras & PhotoSearchExtras.Tags) == PhotoSearchExtras.Tags) extraList.Add("tags"); if ((extras & PhotoSearchExtras.Geo) == PhotoSearchExtras.Geo) extraList.Add("geo"); if ((extras & PhotoSearchExtras.MachineTags) == PhotoSearchExtras.MachineTags) extraList.Add("machine_tags"); if ((extras & PhotoSearchExtras.OriginalDimensions) == PhotoSearchExtras.OriginalDimensions) extraList.Add("o_dims"); if ((extras & PhotoSearchExtras.Views) == PhotoSearchExtras.Views) extraList.Add("views"); if ((extras & PhotoSearchExtras.Media) == PhotoSearchExtras.Media) extraList.Add("media"); if ((extras & PhotoSearchExtras.PathAlias) == PhotoSearchExtras.PathAlias) extraList.Add("path_alias"); if ((extras & PhotoSearchExtras.SquareUrl) == PhotoSearchExtras.SquareUrl) extraList.Add("url_sq"); if ((extras & PhotoSearchExtras.ThumbnailUrl) == PhotoSearchExtras.ThumbnailUrl) extraList.Add("url_t"); if ((extras & PhotoSearchExtras.SmallUrl) == PhotoSearchExtras.SmallUrl) extraList.Add("url_s"); if ((extras & PhotoSearchExtras.MediumUrl) == PhotoSearchExtras.MediumUrl) extraList.Add("url_m"); if ((extras & PhotoSearchExtras.Medium640Url) == PhotoSearchExtras.Medium640Url) extraList.Add("url_z"); if ((extras & PhotoSearchExtras.LargeSquareUrl) == PhotoSearchExtras.LargeSquareUrl) extraList.Add("url_q"); if ((extras & PhotoSearchExtras.Small320Url) == PhotoSearchExtras.Small320Url) extraList.Add("url_n"); if ((extras & PhotoSearchExtras.LargeUrl) == PhotoSearchExtras.LargeUrl) extraList.Add("url_l"); if ((extras & PhotoSearchExtras.OriginalUrl) == PhotoSearchExtras.OriginalUrl) extraList.Add("url_o"); if ((extras & PhotoSearchExtras.Description) == PhotoSearchExtras.Description) extraList.Add("description"); if ((extras & PhotoSearchExtras.Usage) == PhotoSearchExtras.Usage) extraList.Add("usage"); if ((extras & PhotoSearchExtras.Visibility) == PhotoSearchExtras.Visibility) extraList.Add("visibility"); if ((extras & PhotoSearchExtras.Rotation) == PhotoSearchExtras.Rotation) extraList.Add("rotation"); return String.Join(",", extraList.ToArray()); }
/// <summary> /// Returns a list of your photos with no tags. /// </summary> /// <param name="extras">A comma-delimited list of extra information to fetch for each returned record.</param> /// <param name="page">The page of results to return. If this argument is omitted, it defaults to 1.</param> /// <param name="perPage">Number of photos to return per page. If this argument is omitted, it defaults to 100. The maximum allowed value is 500.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PhotosGetUntaggedAsync(int page, int perPage, PhotoSearchExtras extras, Action<FlickrResult<PhotoCollection>> callback) { PartialSearchOptions o = new PartialSearchOptions(); o.Page = page; o.PerPage = perPage; o.Extras = extras; PhotosGetUntaggedAsync(o, callback); }
/// <summary> /// Utility method to convert the <see cref="PhotoSearchExtras"/> enum to a string. /// </summary> /// <example> /// <code> /// PhotoSearchExtras extras = PhotoSearchExtras.DateTaken & PhotoSearchExtras.IconServer; /// string val = Utils.ExtrasToString(extras); /// Console.WriteLine(val); /// </code> /// outputs: "date_taken,icon_server"; /// </example> /// <param name="extras"></param> /// <returns></returns> public static string ExtrasToString(PhotoSearchExtras extras) { List <string> extraList = new List <string>(); if ((extras & PhotoSearchExtras.DateTaken) == PhotoSearchExtras.DateTaken) { extraList.Add("date_taken"); } if ((extras & PhotoSearchExtras.DateUploaded) == PhotoSearchExtras.DateUploaded) { extraList.Add("date_upload"); } if ((extras & PhotoSearchExtras.IconServer) == PhotoSearchExtras.IconServer) { extraList.Add("icon_server"); } if ((extras & PhotoSearchExtras.License) == PhotoSearchExtras.License) { extraList.Add("license"); } if ((extras & PhotoSearchExtras.OwnerName) == PhotoSearchExtras.OwnerName) { extraList.Add("owner_name"); } if ((extras & PhotoSearchExtras.OriginalFormat) == PhotoSearchExtras.OriginalFormat) { extraList.Add("original_format"); } if ((extras & PhotoSearchExtras.LastUpdated) == PhotoSearchExtras.LastUpdated) { extraList.Add("last_update"); } if ((extras & PhotoSearchExtras.Tags) == PhotoSearchExtras.Tags) { extraList.Add("tags"); } if ((extras & PhotoSearchExtras.Geo) == PhotoSearchExtras.Geo) { extraList.Add("geo"); } if ((extras & PhotoSearchExtras.MachineTags) == PhotoSearchExtras.MachineTags) { extraList.Add("machine_tags"); } if ((extras & PhotoSearchExtras.OriginalDimensions) == PhotoSearchExtras.OriginalDimensions) { extraList.Add("o_dims"); } if ((extras & PhotoSearchExtras.Views) == PhotoSearchExtras.Views) { extraList.Add("views"); } if ((extras & PhotoSearchExtras.Media) == PhotoSearchExtras.Media) { extraList.Add("media"); } if ((extras & PhotoSearchExtras.PathAlias) == PhotoSearchExtras.PathAlias) { extraList.Add("path_alias"); } if ((extras & PhotoSearchExtras.SquareUrl) == PhotoSearchExtras.SquareUrl) { extraList.Add("url_sq"); } if ((extras & PhotoSearchExtras.ThumbnailUrl) == PhotoSearchExtras.ThumbnailUrl) { extraList.Add("url_t"); } if ((extras & PhotoSearchExtras.SmallUrl) == PhotoSearchExtras.SmallUrl) { extraList.Add("url_s"); } if ((extras & PhotoSearchExtras.MediumUrl) == PhotoSearchExtras.MediumUrl) { extraList.Add("url_m"); } if ((extras & PhotoSearchExtras.Medium640Url) == PhotoSearchExtras.Medium640Url) { extraList.Add("url_z"); } if ((extras & PhotoSearchExtras.LargeSquareUrl) == PhotoSearchExtras.LargeSquareUrl) { extraList.Add("url_q"); } if ((extras & PhotoSearchExtras.Small320Url) == PhotoSearchExtras.Small320Url) { extraList.Add("url_n"); } if ((extras & PhotoSearchExtras.LargeUrl) == PhotoSearchExtras.LargeUrl) { extraList.Add("url_l"); } if ((extras & PhotoSearchExtras.OriginalUrl) == PhotoSearchExtras.OriginalUrl) { extraList.Add("url_o"); } if ((extras & PhotoSearchExtras.Description) == PhotoSearchExtras.Description) { extraList.Add("description"); } if ((extras & PhotoSearchExtras.Usage) == PhotoSearchExtras.Usage) { extraList.Add("usage"); } if ((extras & PhotoSearchExtras.Visibility) == PhotoSearchExtras.Visibility) { extraList.Add("visibility"); } if ((extras & PhotoSearchExtras.Rotation) == PhotoSearchExtras.Rotation) { extraList.Add("rotation"); } if ((extras & PhotoSearchExtras.Large1600Url) == PhotoSearchExtras.Large1600Url) { extraList.Add("url_h"); } if ((extras & PhotoSearchExtras.Large2048Url) == PhotoSearchExtras.Large2048Url) { extraList.Add("url_k"); } if ((extras & PhotoSearchExtras.Medium800Url) == PhotoSearchExtras.Medium800Url) { extraList.Add("url_c"); } return(String.Join(",", extraList.ToArray())); }
/// <summary> /// Return a list of your photos that have been recently created or which have been recently modified. /// Recently modified may mean that the photo's metadata (title, description, tags) /// may have been changed or a comment has been added (or just modified somehow :-) /// </summary> /// <param name="minDate">The date from which modifications should be compared.</param> /// <param name="extras">A list of extra information to fetch for each returned record.</param> /// <param name="perPage">Number of photos to return per page. If this argument is omitted, it defaults to 100. The maximum allowed value is 500.</param> /// <param name="page">The page of results to return. If this argument is omitted, it defaults to 1.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PhotosRecentlyUpdatedAsync(DateTime minDate, PhotoSearchExtras extras, int page, int perPage, Action<FlickrResult<PhotoCollection>> callback) { CheckRequiresAuthentication(); Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.photos.recentlyUpdated"); parameters.Add("min_date", UtilityMethods.DateToUnixTimestamp(minDate)); if (extras != PhotoSearchExtras.None) parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); if (perPage > 0) parameters.Add("per_page", perPage.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (page > 0) parameters.Add("page", page.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); GetResponseAsync<PhotoCollection>(parameters, callback); }
/// <summary> /// Constructor taking a perPage and page parameter and a default <see cref="PhotoSearchExtras"/> parameter. /// </summary> /// <param name="perPage">The number of photos to return per page (maximum).</param> /// <param name="page">The page number to return.</param> /// <param name="extras">See <see cref="PhotoSearchExtras"/> for more details.</param> public PartialSearchOptions(int perPage, int page, PhotoSearchExtras extras) { PerPage = perPage; Page = page; Extras = extras; }
/// <summary> /// Return the list of photos belonging to your contacts that have been commented on recently. /// </summary> /// <param name="dateLastComment">Limits the resultset to photos that have been commented on since this date. The default, and maximum, offset is (1) hour.</param> /// <param name="extras"></param> /// <param name="page">The page of results to return. If this argument is omitted, it defaults to 1.</param> /// <param name="perPage">Number of photos to return per page. If this argument is omitted, it defaults to 100. The maximum allowed value is 500.</param> /// <returns></returns> public PhotoCollection PhotosCommentsGetRecentForContacts(DateTime dateLastComment, PhotoSearchExtras extras, int page, int perPage) { return PhotosCommentsGetRecentForContacts(dateLastComment, null, extras, page, perPage); }
public static string ToString(this PhotoSearchExtras extras) { return(null); }
/// <summary> /// Return the list of photos for a gallery. /// </summary> /// <param name="galleryId">The ID of the gallery of photos to return.</param> /// <param name="extras">A list of extra information to fetch for each returned record.</param> /// <returns></returns> public GalleryPhotoCollection GalleriesGetPhotos(string galleryId, PhotoSearchExtras extras) { Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.galleries.getPhotos"); parameters.Add("gallery_id", galleryId); if (extras != PhotoSearchExtras.None) parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); return GetResponseCache<GalleryPhotoCollection>(parameters); }
/// <summary> /// Gets a list of photos for the given panda. /// </summary> /// <param name="pandaName">The name of the panda to return photos for.</param> /// <param name="extras">The extras to return with the photos.</param> /// <returns>A list of photos for the panda.</returns> public PandaPhotoCollection PandaGetPhotos(string pandaName, PhotoSearchExtras extras) { return(PandaGetPhotos(pandaName, extras, 0, 0)); }