FQL查询以查找公共事件 [英] FQL query for finding public event

查看:94
本文介绍了FQL查询以查找公共事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想执行FQL查询,以检索特定区域中的所有公共事件(使用经度,纬度和最大距离,或仅使用位置名称).你知道这有可能吗?

I would like to execute an FQL query for retrieving all the public events in a specific area (using longitude,latitude and maximum distance or simply location name). Do you know if it's possible?

显然,有人能够以某种方式做到这一点: http://elmcity.info/fb_events?location =东京

Apparently, somebody is able to do it, somehow: http://elmcity.info/fb_events?location=tokyo

推荐答案

使用基于位置的搜索"确实可以接收事件 为此,您需要要搜索的位置的经度和纬度坐标以及具有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;

诀窍本身在于场地,经度和场地,纬度使用情况.要从城市获取事件,只需获取城市坐标并根据需要调整偏移量即可. 如果您不知道如何使用FQL,请查看 Facebook PHP SDK

The trick itself lies in the venue.longitude and venue.latitude useage. To get events from a city, just get the city coordinates and adjust the offset to your needs. If you don't know how to use FQL please look into Facebook PHP SDK

这篇关于FQL查询以查找公共事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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