通过已知的电子邮件地址查找Facebook用户(URL到个人资料页面) [英] Find Facebook user (url to profile page) by known email address

查看:848
本文介绍了通过已知的电子邮件地址查找Facebook用户(URL到个人资料页面)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个电子邮件地址,并想知道是否有一个Facebook用户链接到这个地址。如果有,那么我想要检索这个用户个人资料页面的url并保存在某个地方。
我做有一个Facebook应用程序,但如果需要,我将使用现有的帐户数据登录到Facebook并执行任务。


$ b $我认为这是一件容易的事情,但不知何故不是。我阅读了 Graph API 文档,然后找到有关如何搜索公共数据的说明。它的格式是:

https://graph.facebook.com/search?q=QUERY&type=OBJECT_TYPE



但是,请尝试使用类型参数中的 q 参数和用户中的电子邮件地址信息导致OAuthException 表示需要访问令牌来请求此资源。
但是,如果您单击示例搜索链接,Facebook会生成一个URL所提到的访问令牌与当前登录的用户相关。使用此令牌执行搜索会提供预期的结果。但是我无法弄清楚如何在登录之后获取此用户会话访问令牌。每当我搜索如何获取访问令牌时,我只会查找有关Facebook应用程序的信息,并检索基本或特定数据访问权限。正如我所说,这不是我正在寻找的,因为我没有,不需要一个Facebook应用程序。



由于Facebook给我所需在示例链接中的令牌我认为它也不应该是一个问题。还是他们只有因为家里的优势呢?
另外, Outlook社交连接器Facebook的提供者只能通过电子邮件地址(以及提供的帐户数据)来检索Facebook数据。所以我想,如果微软可以做这个事情,我也应该可以做同样的事情。



最后但并非最不重要的是,我从理论上和实际上都更沮丧通过搜索电子邮件地址,我已经能够找到用户个人资料的URL。我甚至不必登录到Facebook。这不是官方的API方式。

如果我执行一个网页请求到$ code> http://www.facebook.com/search.php?init=s:email&q= example@domain.com& type = users 我得到预期的搜索结果。问题是我必须解析HTML代码并提取url(没关系),结果页面可能会发生变化,并且可能会轻易地破坏我的方法来提取url(有问题的)。



任何人都有一个想法,什么是完成给定任务的最佳方法?

解决方案

这个确定的答案是从Facebook本身。在今天发布的 https://developers.facebook.com/bugs/335452696581712 上,Facebook开发人员说

 将电子邮件地址传递到用户搜索类型的功能是2013年7月10日删除的
。类型只返回匹配
a用户名(包括备用名称)的结果。

所以,唉,简单的答案是你不能再用他们的电子邮件地址搜索用户了。这很糟糕,但这是Facebook的新规定。


I have an email address and want to find out if there is a Facebook user linked to this address. If there is, then I want to retrieve the url to this users profile page and save it somewhere. I do not have a facebook application, but, if necessary, I would use existing account data to login to facebook and perform the task.

I thought this would be an easy task, but somehow it's not. I read through the Graph API documentation and there you find instructions on how to search public data. It says the format is:
https://graph.facebook.com/search?q=QUERY&type=OBJECT_TYPE

But trying this with an email address in the q param and user in the type param without further information results in an OAuthException saying "An access token is required to request this resource." However, if you click the example search links Facebook generates a url with the mentioned access token related to the currently logged on user. Performing searches with this token gives the expected results. But i cannot figure out how to get this user session access token after logging in. Every time I search on how to get an access token I only find information regarding Facebook apps and retrieving permissions for basic or specific data access. This is, as I mentioned, not what I am looking for, as I don't have and don't need a facebook app.

Since Facebook gives me the needed token in the example links I thought it shouldn't be a problem to get it too. Or do they only have it because of home advantage? Also, the Outlook Social Connector Provider for Facebook is able to retrieve Facebook data just via an email address (and the account data provided). So I thought, if Microsoft can do this stuff I should be also possible to do simliar things.

Last but not least this is the more frustrating since I, theoretically and practically, am already able to find users profile url just by searching for the email address. I don't even have to be logged on to Facebook. And it's not the official API way.
If I perform a web request to http://www.facebook.com/search.php?init=s:email&q=example@domain.com&type=users I get the expected search result. The problem is that I have to parse the HTML code and extract the url (that's okay) and that the result page is possibly subject to change and could easily break my method to extract the url (problematic).

So does anybody has an idea what's the best way to accomplish the given task?

解决方案

The definitive answer to this is from Facebook themselves. In post today at https://developers.facebook.com/bugs/335452696581712 a Facebook dev says

The ability to pass in an e-mail address into the "user" search type was
removed on July 10, 2013. This search type only returns results that match
a user's name (including alternate name).

So, alas, the simple answer is you can no longer search for users by their email address. This sucks, but that's Facebook's new rules.

这篇关于通过已知的电子邮件地址查找Facebook用户(URL到个人资料页面)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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