从电子邮件地址获取Facebook个人资料图片 [英] Getting a facebook profile picture from an email address
问题描述
我正在尝试根据他们的电子邮件地址获取用户的Facebook个人资料图片。实际上,我想向用户提供使用Gravatar形象或Facebook的选项。但是,我知道获取用户的Facebook图像的唯一方式是通过以下方式:
I'm trying to get a user's facebook profile picture based on their email address. Effectively, I want to offer my users the option between using Gravatar for their image, or Facebook. However, the only way I know of to get a user's facebook image is via:
http://graph.facebook.com/ [FBOOK USERNAME] / picture?type = large
由于用户名可能会在Facebook和我的网站之间变化,我想通过电子邮件地址而不是用户名。我如何通过电子邮件地址查询某人的Facebook个人资料图片?
Since the usernames may vary between facebook and my site, I would like to do this via email address rather than username. How do I query for someone's facebook profile picture via email address?
推荐答案
我看到这个问题已经有几年了,但是可以使用Graph API进行相同的搜索方法:
I see this question has a couple of years already but the same search approach can be taken using the Graph API:
GET https://graph.facebook.com/search?q={EMAIL} & type = user
您可以在图形API资源管理器。你不会直接得到个人资料图片,但是您可以获得用户标识,您可以轻松使用该标识来获取公开的个人资料。
You can try this on the Graph API Explorer. You don't get the profile picture directly but you get the user id which you can easily use to get the public profile picture.
https: //graph.facebook.com/{UID}/picture
这篇关于从电子邮件地址获取Facebook个人资料图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!