Skip to content

Commit

Permalink
Merge pull request #7 from z1c0/master
Browse files Browse the repository at this point in the history
albumId option + feedback
  • Loading branch information
esteban-uo authored Oct 8, 2016
2 parents 66a5cf7 + 11a25a2 commit 6bc9d0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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
4 changes: 3 additions & 1 deletion src/picasa.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down

0 comments on commit 6bc9d0d

Please sign in to comment.