mirror of
https://github.com/jlengrand/picasa.git
synced 2026-03-10 08:31:19 +00:00
albumId ption
The "options" object passed to "getPhotos" now looks for an "albumId" property and retrieves only photos for this specific album. Updated sample code. Implemented feedback
This commit is contained in:
@@ -33,6 +33,7 @@ const picasa = new Picasa()
|
||||
|
||||
const options = {
|
||||
maxResults : 10 // by default get all
|
||||
albumId : "6338620891611370881" // by default all photos are selected
|
||||
}
|
||||
|
||||
picasa.getPhotos(accessToken, options, (error, photos) => {
|
||||
@@ -109,4 +110,4 @@ MIT ©
|
||||
|
||||
Play around https://developers.google.com/oauthplayground/?code=4/usq8QmuezR3Au_0UKyj9-UXmf6Bw_ij8KFWgIziYbpM#
|
||||
|
||||
Picasa Docs https://developers.google.com/picasa-web/docs/2.0/developers_guide_protocol
|
||||
Picasa Docs https://developers.google.com/picasa-web/docs/2.0/developers_guide_protocol
|
||||
@@ -112,10 +112,12 @@ function getPhotos (accessToken, options, callback) {
|
||||
|
||||
if (options.maxResults) accessTokenParams['max-results'] = options.maxResults
|
||||
|
||||
const albumPart = options.albumId ? `/albumid/${options.albumId}` : '';
|
||||
|
||||
const requestQuery = querystring.stringify(accessTokenParams)
|
||||
|
||||
const requestOptions = {
|
||||
url : `${PICASA_SCOPE}${PICASA_API_FEED_PATH}?${requestQuery}`,
|
||||
url : `${PICASA_SCOPE}${PICASA_API_FEED_PATH}${albumPart}?${requestQuery}`,
|
||||
headers: {
|
||||
'GData-Version': '2'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user