开发者

How to order results for Facebook Graph API?

开发者 https://www.devze.com 2023-01-09 08:36 出处:网络
I\'ve been playing around the Facebook Graph API for a while now. I\'m trying to get the list of friends using https://graph.facebook.com/me/friends.

I've been playing around the Facebook Graph API for a while now.

I'm trying to get the list of friends using https://graph.facebook.com/me/friends.

While it's working fine, the results are ordered by Id. Is there a way to get them ordered by name, or do I have to reorder them manually via my application layer?

开发者_Go百科Thanks!


I don't think there is a way of ordering Graph API results, but you can order FQL results. Something like:

SELECT name, uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = $current_user_id) ORDER BY name
0

精彩评论

暂无评论...
验证码 换一张
取 消