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

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

问题描述

我有一个电子邮件地址,想知道是否有 Facebook 用户链接到此地址.如果有,那么我想检索此用户个人资料页面的 url 并将其保存在某处.我没有有 Facebook 应用程序,但如有必要,我会使用现有帐户数据登录 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.

我认为这将是一项简单的任务,但不知何故并非如此.我通读了 Graph API 文档,在那里您可以找到有关如何搜索公共数据的说明.它说格式是:
https://graph.facebook.com/search?q=QUERY&type=OBJECT_TYPE

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

但是尝试使用 q 参数中的电子邮件地址和 type 参数中的 user 而没有更多信息会导致 OAuthException请求此资源需要访问令牌."但是,如果您单击示例搜索链接,Facebook 会生成一个包含与当前登录用户相关的访问令牌的 URL.使用此标记执行搜索会得到预期的结果.但我无法弄清楚如何在登录后获取此用户会话访问令牌.每次我搜索如何获取访问令牌时,我只能找到有关 Facebook 应用程序和检索基本或特定数据访问权限的信息.正如我所提到的,这不是我想要的,因为我没有也不需要 Facebook 应用.

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.

由于 Facebook 在示例链接中为我提供了所需的令牌,因此我认为获取它也不会有问题.还是他们只是因为主场优势才拥有它?此外,Facebook 的 Outlook 社交连接器提供程序 能够仅通过电子邮件地址(以及提供的帐户数据)检索 Facebook 数据.所以我想,如果微软能做这个东西,我应该也可以做类似的事情.

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.

最后但并非最不重要的是,这更令人沮丧,因为从理论上和实际上,我已经能够仅通过搜索电子邮件地址来找到用户的个人资料网址.我什至不必登录 Facebook.这不是官方的 API 方式.
如果我对 http://www.facebook.com/search.php?init=s:email&q=example@domain.com&type=users 执行网络请求,我会得到预期的搜索结果.问题是我必须解析 HTML 代码并提取 url(没关系)并且结果页面可能会发生变化并且很容易破坏我提取 url 的方法(有问题).

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?

推荐答案

对此的最终答案来自 Facebook 自己.今天在 https://developers.facebook.com/bugs/335452696581712 的帖子中,Facebook 开发人员说

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).

唉,答案很简单,您不能再通过电子邮件地址搜索用户.这很糟糕,但这是 Facebook 的新规则.

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 用户(个人资料页面的网址)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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