2
votes

I'm trying to display facebook album photos on my rails 3.12 app via the Koala gem by first accessing the users albums. I know how get the album:

u.facebook.get_connections('me', 'albums') 

but there is no direct access to the individual albums photos. There is a link in the album object to a facebook page that shows all the album photos but that is about it. I need to be able to drill down further via the graph API to get the individual photo objects but I don't know how to do so with Koala. I prefer Koala based solutions but I am open to any solutions at all.

Thanks...

3

3 Answers

3
votes

I was able to drill down and access the photos inside the album by using the following:

current_user.facebook.get_connections("me","albums", :fields => "name, photos.fields(source)")
2
votes

First, you have to use the "user_photos" access_token. and then fetch the id of the album usign :

albums = u.facebook.get_connections('me', 'albums') 

then extract the album you want, and use the id of the album to fetch photos :

get_connections('#{album['id']}', 'photos')

I haven't tried it in ruby (I used the graph explorer), so tell me if it works :)

2
votes

This just worked for me! @graph.get_connections(album['ALBUM_ID'], "photos"])