使用Koala按名字搜索Facebook [英] Search Facebook by first name with Koala

查看:106
本文介绍了使用Koala按名字搜索Facebook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

之前,考拉/facebook让我这样做:

Before, Koala/facebook would let me do this:

graph.search("Ted", {:type => "user"})

现在,它返回一个空数组.

Now, it returns an empty array.

似乎现在只能搜索不常用或全名.例如:

It seems one can only search by uncommon or full names now. For example:

graph.search("Ted Turner", {:type => "user"})

...返回结果,同样如此:

...returns results, as does:

graph.search("Lizbeth", {:type => "user"}).

如何使用Koala按名字搜索?

How can I search by first name using Koala?

推荐答案

这可能是由于Facebook处理搜索结果的方式所致.

It's possible this is due to the way Facebook handles search results.

基本上,他们要做的是首先获取(X)请求的结果.其次,它们基于隐私过滤结果(删除不想被搜索的用户).最后,他们返回剩下的东西.

Basically, what they do is first they grab the (X) requested results. Second, they filter the results based on privacy (removing users who do not want to be searched). Finally they return what's left.

因此,假设Koala要求提供100个用户,而Facebook找到的前100个用户都设置了隐私设置以隐藏自己;结果将是Facebook返回一个空列表,而Koala没有给您任何东西.

So suppose Koala's asking for 100 users, and the first 100 users that Facebook finds all have privacy set up to keep themselves hidden; the result will be Facebook returning an empty list and Koala giving you nothing.

详细信息可以在这里找到: https://developers.facebook.com/blog/post /478/

Details can be found here: https://developers.facebook.com/blog/post/478/

有可能的解决方案,但没有一个真的那么好: 1)增加您请求的结果数量(通过选项或编写FQL查询) 2)如果您得到的结果是空的,请立即使用分页再次尝试调用,这一次是在询问下一页.这意味着如果您要求前100个用户,却一无所获,请立即询问101-200的列表.但是,请确保限制执行此操作的次数,因为您可能不希望它发出太多呼叫.

There are possible solutions, but none of them are really that great: 1) Increase the number of results you request (either through options, or writing an FQL query instead) 2) If you get an empty set of results, immediately use pagination to try calling again, this time asking for the next page. Meaning if you ask for the first 100 users, get nothing, immediately ask for the list of 101-200. Make sure you limit how many times this is done, however, because you probably don't want it to make too many calls.

我也不是很好的解决方案.由于没有告知您缺少哪些条目,因此很难获得适当的集合,因此您可能必须处理不完整的列表.

Neither are great solutions, I know. The fact that you aren't told which entries are missing makes it difficult to get a proper set, so you'll probably have to deal with incomplete lists.

这篇关于使用Koala按名字搜索Facebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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