nov / fb_graph

This gem doesn't support FB Graph API v2.0+. Please use fb_graph2 gem instead.
MIT License
1.04k stars 191 forks source link

/photos/uploaded & /videos/uploaded not supported? #356

Closed steffen closed 10 years ago

steffen commented 10 years ago

I found four api "edges" that don't seem to be supported by the fb_graph gem:

/{page-id}/photos/uploaded /{page-id}/videos/uploaded /{user-id}/photos/uploaded /{user-id}/videos/uploaded

See docs for /page/photos as example: https://developers.facebook.com/docs/graph-api/reference/page/photos/

The response is the same format as the response for /photos or /videos.

I'm thinking of adding a def uploaded_photos(options = {}) method to FbGraph::Connections::Photos which calls photos = self.connection "photos/uploaded", options instead of photos = self.connection :photos, options and abstracting the mapping into a private method to share it between photos and uploaded_photos.

Any thoughts?

nov commented 10 years ago

There is options = {connection_scope: 'uploaded'} would work. FbGraph::Connections::Insights#insights uses the connection_scope option. https://github.com/nov/fb_graph/blob/master/lib/fb_graph/connections/insights.rb

Of course, you can make an alias user.uploaded_photos instead of calling user.photos(connection_scope: :uploaded) though.

steffen commented 10 years ago

Oh, thanks so much. I didn't know about connection_scope and this is all I needed. I will close this issue then as /uploaded is supported. Thanks!