Flickrex.Flickr.Galleries (flickrex v0.8.1) View Source
Link to this section Summary
Functions
Add a photo to a gallery.
Create a new gallery for the calling user.
Modify the meta-data for a gallery.
Edit the comment for a gallery photo.
Modify the photos in a gallery. Use this method to add, remove and re-order photos.
This method does not require authentication.
Return the list of galleries created by a user. Sorted from newest to oldest.
Return the list of galleries to which a photo has been added. Galleries are returned sorted by date which the photo was added to the gallery.
Return the list of photos for a gallery
Remove a photo from a gallery.
Link to this section Types
Specs
arg() :: String.Chars.t()
Specs
operation() :: Flickrex.Operation.Rest.t()
Specs
opts() :: Flickrex.Rest.args()
Link to this section Functions
Specs
Add a photo to a gallery.
This method requires authentication with "write" permission.
Arguments
gallery_id- The ID of the gallery to add a photo to. Note: this is the compound ID returned in methods like <a href="https://www.flickr.com/services/api/flickr.galleries.getList.html">flickr.galleries.getList</a>, and <a href="https://www.flickr.com/services/api/flickr.galleries.getListForPhoto.html">flickr.galleries.getListForPhoto</a>.photo_id- The photo ID to add to the gallery
Options
comment- A short comment or story to accompany the photo.full_response- If specified, return updated details of the gallery the photo was added to
Specs
Create a new gallery for the calling user.
This method requires authentication with "write" permission.
Arguments
title- The name of the gallerydescription- A short description for the gallery
Options
primary_photo_id- The first photo to add to your galleryfull_result- Get the result in the same format as galleries.getList
Example response
%{
"gallery" => %{
"id" => "50736-72157623680420409",
"url" => "http://www.flickr.com/photos/kellan/galleries/72157623680420409"
},
"stat" => "ok"
} Specs
Modify the meta-data for a gallery.
This method requires authentication with "write" permission.
Arguments
gallery_id- The gallery ID to update.title- The new title for the gallery.
Options
description- The new description for the gallery.
Specs
Edit the comment for a gallery photo.
This method requires authentication with "write" permission.
Arguments
gallery_id- The ID of the gallery to add a photo to. Note: this is the compound ID returned in methods like flickr.galleries.getList, and flickr.galleries.getListForPhoto.photo_id- The photo ID to add to the gallery.comment- The updated comment the photo.
Specs
Modify the photos in a gallery. Use this method to add, remove and re-order photos.
This method requires authentication with "write" permission.
Arguments
gallery_id- The id of the gallery to modify. The gallery must belong to the calling user.primary_photo_id- The id of the photo to use as the 'primary' photo for the gallery. This id must also be passed along in photo_ids list argument.photo_ids- A comma-delimited list of photo ids to include in the gallery. They will appear in the set in the order sent. This list must contain the primary photo id. This list of photos replaces the existing list.
Specs
This method does not require authentication.
Arguments
gallery_id- The gallery ID you are requesting information for.
Options
primary_photo_size- size of the primary photocover_photos_size- size of the cover photos (excluding the primary photo)limit- number of cover photos to fetch for galleries without a primary photo. Default is 6short_limit- number of cover photos to fetch (excluding primary photo) for galleries with a primary photo. Default is 2.
Example response
%{
"gallery" => %{
"count_photos" => "17",
"count_videos" => "0",
"date_create" => "1241028772",
"date_update" => "1270111667",
"description" => %{},
"id" => "6065-72157617483228192",
"owner" => "35034348999@N01",
"primary_photo_farm" => "1",
"primary_photo_id" => "292882708",
"primary_photo_secret" => "7f29861bc4",
"primary_photo_server" => "112",
"title" => %{"_content" => "Cat Pictures I've Sent To Kevin Collins"},
"url" => "http://www.flickr.com/photos/straup/galleries/72157617483228192"
},
"stat" => "ok"
} Specs
Return the list of galleries created by a user. Sorted from newest to oldest.
This method does not require authentication.
Arguments
user_id- The NSID of the user to get a galleries list for. If none is specified, the calling user is assumed.continuation- The first request must pass the "continuation" parameter with the value of "0". The server responds back with a response that includes the "continuation" field along with "pages" and "total" fields in the response. For the subsequent requests, the client must relay the value of the "continuation" response field as the value of the "continuation" request parameter. On the last page of results, the server will respond with a continuation value of "-1".short_limit- number of cover photos to fetch (excluding primary photo) for galleries with a primary photo. Default is 2.
Options
per_page- Number of galleries to return per page. If this argument is omitted, it defaults to 100. The maximum allowed value is 500.page- The page of results to return. If this argument is omitted, it defaults to 1.primary_photo_extras- A comma-delimited list of extra information to fetch for the primary photo. Currently supported fields are: license, date_upload, date_taken, owner_name, icon_server, original_format, last_update, geo, tags, machine_tags, o_dims, views, media, path_alias, url_sq, url_t, url_s, url_m, url_osort_groups- A comma-separated list of groups used to sort the output sets. If has_photo is present, any of the calling user's galleries containing photos referred to in photo_ids will be returned before other galleries. If suggested is present, a number of suggested galleries will be returned before other sets. The order of the sort_groups will dictate the order that the groups are returned in. Only available if continuation is used. The resulting output will include a "sort_group" parameter indicating the sort_group that each set is part of, or null if not applicablephoto_ids- A comma-separated list of photo ids. If specified along with has_photo in sort_groups, each returned gallery will include a list of these photo ids that are present in the gallery as "has_requested_photos"cover_photos- set to 1 if cover photos for galleries should be returned. If primary photo exists, 1 primary photo and 2 other photos will be returned (in order). If not, 6 photos in order will be returnedprimary_photo_cover_size- size of primary photo on the cover (if primary photo exists in gallery). will default to 'q' if not setcover_photos_size- size of cover photos (will default to 'q' if not set)limit- number of cover photos to fetch for galleries without a primary photo. Default is 6
Example response
%{
"galleries" => %{
"gallery" => [
%{
"count_photos" => "16",
"count_videos" => "2",
"date_create" => "1257711422",
"date_update" => "1260360756",
"description" => %{"_content" => "black and whites"},
"id" => "5704-72157622637971865",
"owner" => "34427469121@N01",
"primary_photo_farm" => "1",
"primary_photo_id" => "107391222",
"primary_photo_secret" => "ffa",
"primary_photo_server" => "39",
"title" => %{"_content" => "I like me some black & white"},
"url" => "http://www.flickr.com/photos/george/galleries/72157622637971865"
},
%{
"count_photos" => "18",
"count_videos" => "0",
"date_create" => "1256852229",
"date_update" => "1260462343",
"description" => %{},
"id" => "5704-72157622566655097",
"owner" => "34427469121@N01",
"primary_photo_farm" => "1",
"primary_photo_id" => "497374910",
"primary_photo_secret" => "9ae0f",
"primary_photo_server" => "231",
"title" => %{"_content" => "People Sleeping in Libraries"},
"url" => "http://www.flickr.com/photos/george/galleries/72157622566655097"
}
],
"page" => "1",
"pages" => "1",
"per_page" => "100",
"total" => "9",
"user_id" => "34427469121@N01"
},
"stat" => "ok"
} Specs
Return the list of galleries to which a photo has been added. Galleries are returned sorted by date which the photo was added to the gallery.
This method does not require authentication.
Arguments
photo_id- The ID of the photo to fetch a list of galleries for.
Options
per_page- Number of galleries to return per page. If this argument is omitted, it defaults to 100. The maximum allowed value is 500.page- The page of results to return. If this argument is omitted, it defaults to 1.
Example response
%{
"galleries" => %{
"gallery" => [
%{
"count_photos" => "18",
"count_videos" => "0",
"date_create" => "1249748647",
"date_update" => "1260486168",
"description" => %{
"_content" => "The cheap and cheerful camera that isn't quite as cheap as it used to be."
},
"id" => "9634-72157621980433950",
"owner" => "35468159852@N01",
"primary_photo_farm" => "3",
"primary_photo_id" => "2080242123",
"primary_photo_secret" => "55c9",
"primary_photo_server" => "2209",
"title" => %{"_content" => "Vivitar Ultra Wide & Slim Selection"},
"url" => "http://www.flickr.com/photos/revdancatt/galleries/72157621980433950"
},
%{
"count_photos" => "13",
"count_videos" => "0",
"date_create" => "1253035020",
"date_update" => "1260431618",
"description" => %{},
"id" => "22342631-72157622254010831",
"owner" => "22365685@N03",
"primary_photo_farm" => "4",
"primary_photo_id" => "3182914049",
"primary_photo_secret" => "b94fb",
"primary_photo_server" => "3319",
"title" => %{"_content" => "Awesome Pics"},
"url" => "http://www.flickr.com/photos/22365685@N03/galleries/72157622254010831"
}
],
"page" => "1",
"pages" => "1",
"per_page" => "100",
"total" => "7"
},
"stat" => "ok"
} Specs
Return the list of photos for a gallery
This method does not require authentication.
Arguments
gallery_id- The ID of the gallery of photos to return
Options
continuation- Using this parameter indicates to the server that the client is using the new, continuation based pagination rather than the older page/per_page based pagination. The first request must pass the "continuation" parameter with the value of "0". The server responds back with a response that includes the "continuation" field along with the "per_page" field in the response. For the subsequent requests, the client must relay the value of the "continuation" response field as the value of the "continuation" request parameter. On the last page of results, the server will respond with a continuation value of "-1".per_page- chunk size to fetchget_user_info- set to 1 if user details should be returnedget_gallery_info- if set to 1, info about the gallery is also returnedextras- A comma-delimited list of extra information to fetch for each returned record. Currently supported fields are: <code>description</code>, <code>license</code>, <code>date_upload</code>, <code>date_taken</code>, <code>owner_name</code>, <code>icon_server</code>, <code>original_format</code>, <code>last_update</code>, <code>geo</code>, <code>tags</code>, <code>machine_tags</code>, <code>o_dims</code>, <code>views</code>, <code>media</code>, <code>path_alias</code>, <code>url_sq</code>, <code>url_t</code>, <code>url_s</code>, <code>url_q</code>, <code>url_m</code>, <code>url_n</code>, <code>url_z</code>, <code>url_c</code>, <code>url_l</code>, <code>url_o</code>per_page- Number of photos to return per page. If this argument is omitted, it defaults to 100. The maximum allowed value is 500.page- The page of results to return. If this argument is omitted, it defaults to 1.
Example response
%{
"photos" => %{
"page" => "1",
"pages" => "1",
"perpage" => "500",
"photo" => [
%{
"comment" => %{"_content" => "best cat picture ever!"},
"farm" => "1",
"has_comment" => "1",
"id" => "2822546461",
"is_primary" => "1",
"isfamily" => "0",
"isfriend" => "0",
"ispublic" => "1",
"owner" => "78398753@N00",
"secret" => "2dbcdb589f",
"server" => "1",
"title" => "FOO"
},
%{
"farm" => "1",
"has_comment" => "0",
"id" => "2822544806",
"is_primary" => "0",
"isfamily" => "0",
"isfriend" => "0",
"ispublic" => "1",
"owner" => "78398753@N00",
"secret" => "bd93cbe917",
"server" => "1",
"title" => "OOK"
}
],
"total" => "2"
},
"stat" => "ok"
} Specs
Remove a photo from a gallery.
This method requires authentication with "write" permission.
Arguments
gallery_id- The ID of the gallery to remove a photo fromphoto_id- The ID of the photo to remove from the galleryfull_response- If specified, return updated details of the gallery the photo was removed from