chrissearle / gatsby-source-flickr

A simple gatsby source plugin for flickr photo search

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add the ability to query a single user album

aleccool213 opened this issue · comments

This is almost possible already.

The start will be adding the following to gatsby-config:

    {
      resolve: 'gatsby-source-flickr',
      options: {
        api_key: YOUR_FLICKR_KEY,
        user_id: YOUR_FLICKR_USER,
        // Add the following lines
        method: 'flickr.photosets.getPhotos',
        photoset_id: NUMERIC_ID_OF_ALBUM,
      },
    },

However - there is one thing I have to change in code first - search returns this structure:

{
  "photos": {
    "photo": [ list of photos ],
}

getPhotos here returns this structure:

{
  "photoset": {
    "photo": [ list of photos ],
}

So - I need to make it cope with a different outer object name.

I'll try and look at this during the weekend.

Should be working in 0.0.2 (see readme for example)

Amazing, thanks for the quick response. This was the one thing blocking me from using this repo! 💯