Currently, I am using the fb_graph gem to obtain a list of friends:
FbGraph::User.me(fb_token).friends
However, this returns me a massive array with lots of fields, such as name, gender, languages, etc. I want to filter all the fields and have obtain a list of friends.
I could loop through the list extracting the name, however, I was looking for something more efficient.
I was thinking something like:
FbGraph::User.me(fb_token).friends(:name)
Anyone know how to do this? The link to the gem is https://github.com/nov/fb_graph
Thanks!
Is your goal just to end up with the array of names for subsequent use, or is it to avoid retrieving so much data from FB?
You can get the array of names with something like
FbGraph::User.me(fb_token).friends.map {|f| f.name }
That should produce the end result you want. It won't reduce the amount of data pulled from FB, though - unfortunately i haven't used fb_graph enough to help there.