获取基于位置的事件列表 [英] Get event list based on location

查看:174
本文介绍了获取基于位置的事件列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在周围挖上Facebook的开发者网站,看看是否有一种方法可以让我自己的web应用程序的显示本地事件信息。

I've been digging around on the Facebook developer site to see if there is a way to get local event information for display on my own web app.

在理想情况下,我会错过一个位置和Facebook将地方公共事件列表发下来(链接到FB当然)。
但至今我还没有发现它说这是否是可能的任何文件。

Ideally, I would pass up a location and Facebook would send down a list of local public events (with links to FB of course). But as yet I haven't found any documentation which says whether this is possible.

有谁知道这是可能的吗?

Does anyone know if this is possible?

推荐答案

有可能确实接收使用基于位置的事件搜索
要做到这一点,你需要你要搜索的位置的经度和纬度坐标和user_events权限的的access_token(我想你也可以使用公共搜索)

It is possible indeed to receive events using location based "search" To do so you'll need the longitude and latitude coordinates of the location you want to search and a access_token with user_events permission (i think you could also use the public search)

下面是一个例子FQL你怎么能得到附近的地点的所有事件。 (这从您和您的朋友事件搜索):

Here's an FQL example how can you get all the events nearby of a location. (this searches from your and your friends events):

$lat = "40";
$long = "30";

// using offset gives us a "square" on the map from where to search the events
$offset = 0.4;

$events = 'SELECT pic_big, name, venue, location, start_time, eid FROM event WHERE eid IN (SELECT eid FROM event_member WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND start_time > '. $created_time .' OR uid = me()) AND start_time > '. $created_time .' AND venue.longitude < \''. ($long+$offset) .'\' AND venue.latitude < \''. ($lat+$offset) .'\' AND venue.longitude > \''. ($long-$offset) .'\' AND venue.latitude > \''. ($lat-$offset) .'\' ORDER BY start_time ASC '. $limit;

诀窍本身在于venue.longitude和venue.latitude useage。从一个城市获取事件,刚刚拿到城市坐标和调整偏移您的需求。
如果你不知道如何使用FQL请看 Facebook的PHP SDK

这篇关于获取基于位置的事件列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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