2012-09-05 46 views
1

我使用Facebook的API,通過考拉得到了Facebook所有用戶的好友列表中,我有一個問題,當我試圖讓其他用戶的好友列表(如果我有權限)如何考拉

我的代碼:

@graph = Koala::Facebook::GraphAPI.new(@token) 
@friends = @graph.get_connections("another user id", "friends") 

回答

0
@graph.get_connections('me', 'friendlists') 
+0

我認爲這一點是「另一個用戶ID」,而不是「我」 – radiospiel

+0

@ siong1987 - 它獲取只有4個朋友,而不是200如何獲取所有朋友? – kpp

+0

@kpp facebook不允許開發者再次訪問您朋友列表中的所有朋友。只有正在使用相同應用的朋友纔會出現在該列表中。 – siong1987

0

我使用實也通過API考拉...

但是你使用單線你的Facebook朋友列表...

而關於分頁等我以前不擔心......

@profile = @graph.get_object("me") 
# perfectly get facebook friends count :) 
@friends = @graph.get_connection("me", "friends",api_version:"v2.0").raw_response["summary"]["total_count"]