2

我有这个查询:

SELECT uid, name, current_location FROM user WHERE uid IN ( SELECT uid2 FROM friend WHERE uid1 = me() ) AND current_location.id IN (Select current_location.id from user where uid = me() )

它会根据需要为我提供结果,即仅具有特定位置的朋友。我可以使用 Graph API 获得相同的结果吗?假设我有位置 ID。我在图形 API 中试过这个:

me/friends?location.id='111501225536407'&fields=location

使用图形 API 是否可以进行 ^ 排序?

4

2 回答 2

1

不是我能看到的。Graph API 最适合获取对象的所有或最新项目。如果您想按位置过滤这些朋友,则需要在客户端执行此操作。

如果您希望 Facebook 在他们的服务器上预先过滤您的结果,您需要使用 FQL。

于 2013-01-08T19:54:16.610 回答
1

您可以通过图形 api 执行 fql 查询(包括多查询),如下所示:

https://graph.facebook.com/fql?q={"albums":"select aid, name,cover_pid FROM album where owner=me()","album_covers":"select src from photo where pid in (select cover_pid 来自 %23albums)"}&access_token=xxxxxx

url 编码有点棘手。确保多查询中使用的“#”符号编码为 %23

于 2013-01-09T15:03:32.170 回答