aiaio / galleria-facebook

Display Facebook Photos on Your Website with Galleria
53 stars 25 forks source link

Does not load more than 100 images from the album #16

Closed abhinit-dwivedi closed 7 years ago

abhinit-dwivedi commented 8 years ago

Hi,

Thanks a ton for the fantastic plugin. I am running into this issue, where it does not allow us to load more than 100 images from the album. The album has more than 170 pics & i am setting the max value in face book options to 500. I tried 150 & 200 too but it did not help.

facebookOptions: { max: 500, facebook_access_token: 'token_val' }

in order to make sure this is not an inherent issue with galleria itself, I tried to change the max value to 200 in their flickr plugin & it loaded 200 images successfully. As mentioned here in the link:

http://support.galleria.io/discussions/questions/14959-max-photos-100

flickrOptions: { // sort by interestingness max: 150, sort: 'interestingness-desc' }

You can try out the same with this sample FB Album: https://www.facebook.com/media/set/?set=a.157110611120090.1073741826.156117531219398&type=3

Please let me know what to do, in order to load all the images from the album.

Thanks in Advance,

apumapho commented 8 years ago

@abhinit-dwivedi Facebook Graph API is probably limiting you to 100 even if you set a limit of 150 or more. I don't think there's a way around this as the plugin is currently written.

A modification to the plugin could be to hit the Graph API for 100 images, load those into Galleria, then hit the paging.next URL that's returned in the JSON results, rinse and repeat until you've followed all the next links. Happy to review any code if you want to fork.

abhinit-dwivedi commented 8 years ago

Hi @apumapho,

I don't think it's an issue with Facebook graph API, because another plugin based on Graph API is able to load all the image from the album successfully without limiting it to 100.

Please go to: http://carwashvictoria.com/#Gallery

Click on "Timeline Photos" & you would notice that we are able to get all the images from the album, without getting restricted to 100 images.

I believe it's due to something with Galleria instead, but am unable to figure it out myself.

I plan to replace the current plugin by "galleria-facebook", but 100 images limit seems to be creating a roadblock. The plugin currently in use is taken from: https://github.com/dejanstojanovic/Facebook-Album-Browser

Please let me know if you have any suggestions for me to try out.

Thanks in advance!

apumapho commented 8 years ago

@abhinit-dwivedi

It appears the plugin you're currently using is doing something similar to what I suggested...hitting the Graph API and if there is a paging element in the results, and a next url, keep adding to the album.

https://github.com/dejanstojanovic/Facebook-Album-Browser/blob/master/src/jquery.fb.albumbrowser.js#L212

if (result.paging && result.paging.next && result.paging.next != "") {
  loadAlbums(result.paging.next);
}
abhinit-dwivedi commented 8 years ago

Hi @apumapho,

Thanks for pointing me to it and i see that now. I am not well-versed with jquery & i am afraid i would end up breaking the plugin if i try it myself, could we implement the same in this plugin too & load all the images to galleria plugin at once?

Thanks in advance