Facebook Graph API:从场地获取公共事件(无FQL)

时间:2014-08-12 19:17:34

标签: facebook facebook-graph-api

我使用带有FQL的图形api和下面的查询(PHP)

$graph_url= 'https://graph.facebook.com/fql?q='.urlencode(
'SELECT
creator,eid,location,pic_cover,name,description,start_time,end_time,
location,ticket_uri,venue FROM event 
WHERE eid IN 
   (SELECT eid FROM event 
     WHERE contains("'.$name.'") and creator = '.$venue_id.' )
     AND start_time >= now() 
     ORDER BY start_time 
     ASC').
'&access_token='.$access_token.'';

上面的查询返回给定场地ID /名称的所有事件。这对我来说很完美。 但是,我读到FQL已被弃用。我阅读了API文档,但我无法如何将此查询“复制”到有效的Graph API查询中。(没有FQL)

有人能指出我正确的方向吗?

1 个答案:

答案 0 :(得分:1)

解决了,实际上很简单。

$graph_url= 'https://graph.facebook.com/'.$venue_id.'/events?fields=id,cover,name,description,start_time,end_time,location,ticket_uri,venue&limit=1000&since='.$date.'&access_token='.$access_token.'';