你可以与Facebook API基于用户的搜索? [英] Can you make a user-based search with Facebook API?

查看:92
本文介绍了你可以与Facebook API基于用户的搜索?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Facebook上,当你写在搜索框中在上面的东西。


  

像埃里克


您先得到你的朋友叫埃里克的结果,并进一步下跌你会得到你可能认识的人使用X共同的朋友和一些随机的人,你可能知道附近。

是否有可能作出与Facebook的API类似的搜索?

我试过:

<$p$p><$c$c>https://graph.facebook.com/search?q=eric&type=user&fields=id,name&access_token= (我的令牌)

如果我说我的access_token我会得到喜欢在Facebook上的一个搜索想。但我只是得到一些随机Eric的来自世界各地的。

我正在写一个简单的Web应用,并得到这个搜索工作将是伟大的!谢谢!


解决方案

这是可能的程度,但进一步看之前确保这是不是你的应用程序的主要服务,否则你运行复制的核心功能,违反了Facebook的政策风险

您需要考虑的用户FQL表和的朋友表

做一个FQL电话如下:

  SELECT名字从用户其中uid IN(SELECT UID2从相知WHERE UID1 =我())

然后保存从调用JSON响应并使用键盘缓冲算法/插件。

On Facebook when you write something in the search box in the top.

Like 'Eric'

You first get the results with your friends named Eric and further down you get people you might know with X mutual friends and some random people in the vicinity you might know.

Is it possible to make a similar search with the Facebook API?

I've tried:

https://graph.facebook.com/search?q=eric&type=user&fields=id,name&access_token= (my token)

And thought if I added my access_token I would get a search like the one on Facebook. But I just get some random Eric's from all over the world.

I'm writing a simple web application and getting this search to work would be great! Thanks!

解决方案

It's possible to an extent but before looking further ensure this isn't the main service of your app otherwise you run the risk of violating Facebook policy on replicating core functionality.

You need to look into the user FQL table and the friend table

Do an FQL call as follow:

SELECT name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me())

Then save the JSON response from that call and use a typeahead algorithm / plugin.

这篇关于你可以与Facebook API基于用户的搜索?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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