Facebook FQL:获取范围内的签到 [英] Facebook FQL: Get checkins within range

查看:22
本文介绍了Facebook FQL:获取范围内的签到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用 FQL 选择我在指定位置范围内的所有朋友签到?我可以使用 FQL 返回我朋友的签到坐标:

Is there a way to use FQL to select all my friends Checkins that are in range of a specified location? I can use FQL to return my friends checkin coords:

https://api.facebook.com/method/fql.query?access_token={0}&query=SELECT coords FROM checkin WHERE author_uid IN (SELECT uid2 FROMfriend WHERE uid1 = me())

但是我怎样才能添加到上面的查询中来做类似......

but how can I add to the above query to do something like...

Where coords 在 [(New York City, NY) | 10 英里内](长,纬度) |(user.current_location)]

任何帮助将不胜感激.提前致谢.

Any help would be greatly appreciated. Thanks in advance.

编辑(美国东部时间 3 月 9 日下午 3:05):

我主要只是在寻找最终结果 - 不需要在单个 FQL 语句中取回所有内容,甚至不需要使用 FQL(可能是图形 API?)我知道我可能需要将数据取回由于 FQL/图形 api 的限制,可以在本地使用它.我只是想以一种有效的方式来做这件事,这样用户就不必等待 20 秒来加载所有内容.

I'm mainly just looking for an end result - doesn't need to get everything back in a single FQL statement, or even use FQL (graph api, possibly?) I understand I may need to bring it back data back in pieces and work with it locally due to the limitations of FQL/the graph api. I just want to do it in an efficient manner so a user doesn't have to wait 20secs for everything to load.

当前的问题是,如果某人有数百个朋友,并且每个朋友的所有签到都返回,则数据量太大,无法处理.

The immediate problem is that if someone has several hundred friends and all checkins for each friend are returned, that's too much data to work with.

我正在寻找的结果的详细信息是从我所有的朋友开始,最后是他们在过去 X 天内签到的前 10 个地点(基于签到位置 ID 的最高频率),在用户当前 facebook 位置的 Y 距离内,并且该位置的页面属于某个类别的位置,如酒吧.

The granular details of the result I'm looking for is to start with all my friends, and end up with the top 10 places (based of highest frequency of the checkin's location ID) they checked into within the last X days, that are within Y distance of the users current facebook location, and where the location's page falls into a certain category, like a bar.

这就是我正在处理的情况,我希望我附加的附加信息不会使我原来的问题复杂化.谢谢!

That's the scenario I'm dealing with and I hope the additional information I appended doesn't complicate my original question. Thanks!

推荐答案

所以有一些未公开的名为 distance() 的函数可能会对您有所帮助,尽管它效果不佳(特别是因为它仅限于 50 公里半径):

So there's some undocumented function called distance() that might help you, although it doesn't work so well (especially since it's limited to 50km radius):

SELECT coords, author_uid, tagged_uids, target_id, message FROM checkin WHERE target_id IN
(SELECT page_id FROM place WHERE distance(latitude, longitude, "37.75377496892", "-122.42077080676") < 50000)

最大为 50,000 ,这是 FQL(显然未记录)distance函数的输出单位.

Max is 50,000 meters, which is the output unit of FQL's (apparently undocumented) distancefunction.

https://developers.facebook.com/docs/reference/fql/checkin/https://developers.facebook.com/docs/reference/fql/place

这篇关于Facebook FQL:获取范围内的签到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆