本文介绍了如何按位置/城市查询公开的Facebook事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图找出如何做到这一点,并且认为这是不可能的,然后发现这个网站:(由于链接被删除了)

I've been trying to figure out how to do this, and was thinking it wasn't possible, then found this website: (Removed due to a dead link)

你可以按城市搜索,我不知道他们怎么做?正常图形API不允许按位置搜索事件,只要我看到。任何建议/提示/信息将会很棒!

You can search by city there and I have no idea how they do it? The normal graph API's don't allow searching for events by location as far as I can see. Any advice/tips/info would be great!

推荐答案

更新2014-07-02



您不能直接在Facebook API中搜索位置附近的活动。由于最初给出了这个答案,Graph API已经难以搜索事件。

Updated 2014-07-02

You can't directly search the Facebook API for events near a location. Since originally giving this answer, the Graph API has made it harder to search for events.

OP引用的Elmcity脚本在事件中简单地搜索关键字标题。尝试兰开斯特。你会得到一些Lancaster这个词在它们的元数据中的地方。

The Elmcity script referenced by the OP does a simple search for a keyword in the event title. Try "Lancaster" for example. You'll get events that have the word Lancaster somewhere in their metadata.

他们的查询看起来像这样:

Their query looks something like this:

 https://graph.facebook.com/search?q=lancaster&type=event

您还可以搜索一个标题中的非基于位置的字,如野餐,脚本返回事件。

You can also search for a non-location based word in the title like "picnic" and the script returns events.

对于在某个位置附近实际发现事件的问题,在当前的迭代中,场地字段只是一个字符串,所以它与任何Facebook的地方没有任何关系。运行这些查询不会返回任何内容:

For the problem of actually finding events near a location, in the current iteration the "venue" field is only a string, so it has no relationship to any Facebook place. Running these query returns nothing:

https://graph.facebook.com/madisonsquaregarden/events
https://graph.facebool.com/108424279189115/events

所以使用批量请求甚至不可能。

So using a batched request isn't even a possibility.

根据文档FQL似乎是一个更好的解决方案。在中, places.name 列是可索引的!简单,对吧?

According to the documentation FQL seems to be a better solution. In the event documentation, the venue.name column is indexable! Easy, right?

错误。当您运行此FQL查询以在某些位置查找事件时,如下所示:

Wrong. When you run this FQL query to find events at some location like this:

 SELECT name, start_time, venue FROM event WHERE CONTAINS("madison square garden")

你发现 places.name 没有填充。

尝试任何其他变体,如:

Trying any other variation like:

 SELECT name, start_time, venue FROM event WHERE venue.id = 108424279189115

抛出一个声明不可索引的错误。

Throws a "statement not indexable" error.

所以在构建我附近的Facebook事件是杀手级应用程序时,唯一可能的办法是搜索常见的字符串您附近的活动,获得这些活动,然后从结果集中过滤掉不相关的事件。

So while building a "Facebook Events Near Me" is the killer app, the only way that it seems possible is to search for common strings for events near you, get those events, then filter out irrelevant events from the result set.

这篇关于如何按位置/城市查询公开的Facebook事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 00:15