Facebook API - 如何通过 Facebook API 获取 Facebook 用户的个人资料图片(无需用户“允许"应用程序) [英] Facebook API - How do I get a Facebook user's profile image through the Facebook API (without requiring the user to "Allow" the application)

查看:23
本文介绍了Facebook API - 如何通过 Facebook API 获取 Facebook 用户的个人资料图片(无需用户“允许"应用程序)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个 CMS,从他们的 Facebook 中获取用户的个人资料图片URL(即 http://facebook.com/users_unique_url).我怎样才能做到这一点?是否有一个 Faceboook API 调用可以获取用户的个人资料图片 URL,而无需用户允许应用程序?

I'm working on a CMS that fetches a user's profile image from their Facebook URL (that is, http://facebook.com/users_unique_url). How can I accomplish this? Is there a Faceboook API call that fetches a user's profile image URL without the user needing to Allow the application?

推荐答案

只需通过这个URL获取数据:

http://graph.facebook.com/userid_here/picture

userid_here 替换为您想要获取照片的用户的 ID.您也可以使用 HTTPS.

Replace userid_here with id of the user you want to get the photo of. You can also use HTTPS as well.

您可以使用 PHP 的 file_get_contents 函数读取该 URL 并处理检索到的数据.

You can use the PHP's file_get_contents function to read that URL and process the retrieved data.

资源:

http://developers.facebook.com/docs/api

注意:php.ini中,您需要确保OpenSSL 扩展可以使用 PHP 的file_get_contents 函数来读取该 URL.

Note: In php.ini, you need to make sure that the OpenSSL extension is enabled to use thefile_get_contents function of PHP to read that URL.

这篇关于Facebook API - 如何通过 Facebook API 获取 Facebook 用户的个人资料图片(无需用户“允许"应用程序)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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