Facebook FQL查找在某个场地发生的所有活动 [英] Facebook FQL find all events that take place at a certain venue

查看:77
本文介绍了Facebook FQL查找在某个场地发生的所有活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个在城市中列出活动的应用程序。我只想要在某些场地发生的事件被包括在内。由于这些活动都是由许多不同的发起者页面创建的,所以经常发生变化,我认为最简单的方法是搜索匹配我所需场所的场地。如何使用FQL来查询这个或是否可能?
我正在考虑以下一些方面:

I am currently making an app that lists events in a city. I only want events that happen in certain venues to be included. Since the events are all created by many different promoters pages which change very often I thought the easiest way is to search for events whose venue matches my desired venue. How should I use FQL to query this or is it possible? I was thinking something along the lines of:

SELECT eid,name,description FROM event WHERE places.name ='myVenue'

SELECT eid,name,description FROM event WHERE venue.name='myVenue'

但它不工作(我知道语法可能有点偏离)

but it wont work (I know the syntax is probably a bit off)

如果有人有任何想法如何写这个查询,请帮帮我。
非常感谢你。
Niall

If anybody has any idea how to write this query please help. Thank you so much. Niall

推荐答案

这是不可能的,因为场地名称本身不是可索引的字段,虽然它被标记为一个文档(请参阅 https://developers.facebook.com/docs/reference/ FQL /事件/ )。

This is not possible, because the venue name itself is not an indexable field, although it's marked as one in the docs (see https://developers.facebook.com/docs/reference/fql/event/).

我发现有一个复杂的解决方法,但似乎有效:

I found a workaround which is a little complicated, but it seems to work:

select eid,name,description,start_time from event where eid in (SELECT eid FROM event WHERE contains("{YOUR_LOCATION_NAME}")) and venue.id = {YOUR_LOCATION_ID} and start_time > now() order by start_time ASC

所以,你需要先做些什么才能使用是使用其名称和ID的位置进行列表,并逐个查询每个位置。因此,您可以使用Graph API的批量查询功能( https://developers.facebook.com/docs/graph-api/making-multiple-requests/#simple )。

So, what you need to do first to be able to use this is to make a "list" of locations with their names and id, and query each location one by one. Thereby, you can make use of the Batch Query functionality of the Graph API (https://developers.facebook.com/docs/graph-api/making-multiple-requests/#simple).

这篇关于Facebook FQL查找在某个场地发生的所有活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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