Get all the images of facebook friends in ruby ββon rails. you can use koala stone https://github.com/arsduo/koala
He got a nice favor
To get a friend facebbok you can use
@graph = Koala::Facebook::API.new(oauth_access_token) friends = @graph.get_connections("me", "friends") friends.each do |f| f[:image]= @graph.get_picture(f["id"]) end
But this method will take too much time, because you have to send a request for each friend.
To avoid this, you can use the REST API, which supports koala,
@rest = Koala::Facebook::API.new(oauth_access_token) @rest.fql_query(my_fql_query) @rest.fql_multiquery(fql_query_hash)
To record the Fql query, you can use the facebook table structure, which you can find at http://developers.facebook.com/docs/reference/fql/
to get Facebook uid, name and pic, you can use this one.
@rest.fql_query("select uid, name, pic_square from user where uid in (select uid2 from friend where uid1 = me())")
Puneeth
source share