如何找到朋友的过去签到附近的地点? [英] how to find friend's past checkins near a location?

查看:210
本文介绍了如何找到朋友的过去签到附近的地点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,一个用户在某个位置,正在寻找她的朋友,她的距离是她所在的10英里。如何用FQL或图表找到这个?我可以看到的唯一方法是运行如下搜索: https://graph.facebook。 com / search?type = checkin ,然后运行结果,找出哪个位置在10英里内。有更好的方法吗?



感谢您的帮助!



Doles

解决方案

虽然初步答案对我而言是为了我的目的,但很快就变得不足够了。现在,我的头撞在墙上,终于破了(不是我的头 - 墙)。这里有两个更好的方式来找到我需要的东西:



这是找到只是签入:


SELECT checkin_id,coords,tagged_uids,page_id FROM checkin WHERE
(author_uid IN(SELECT uid2 FROM friend WHERE uid1 = me())或
author_uid = me())和coords.latitude< '45 .0'和coords.latitude> '29'
和coords.longitude>' - 175'和coords.longitude<' - 5';


这是找到所有位置的帖子:


SELECT id,page_id FROM location_post WHERE(author_uid IN(SELECT
uid2 FROM friend WHERE uid1 = me())或author_uid = me())和
coords.latitude< '45 .0'和coords.latitude> '29'和
coords .longitude>' - 175'和coords.longitude<' - 5'



In my app, a user is at a location and is looking for her friends who have been anywhere withing 10 miles of where she is. How do I find this with either FQL or graph? The only way that I can see is by running a search like so: https://graph.facebook.com/search?type=checkin and then running through the results to find out which location was within 10 miles. Is there a better way for this?

Thanks for your help!

Doles

解决方案

Although the initial answer did work for me for part of my purpose, it quickly became inadequate. Now, after banging my head against the wall, it finally broke (not my head - the wall). Here are two more BETTER ways that WORK to find what I need:

This is to find just checkins:

SELECT checkin_id, coords, tagged_uids, page_id FROM checkin WHERE (author_uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) or author_uid=me()) and coords.latitude<'45.0' and coords.latitude>'29' and coords.longitude>'-175' and coords.longitude<'-5';

This is to find all location posts:

SELECT id, page_id FROM location_post WHERE (author_uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) or author_uid=me()) and coords.latitude<'45.0' and coords.latitude>'29' and coords.longitude>'-175' and coords.longitude<'-5'

这篇关于如何找到朋友的过去签到附近的地点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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