且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Facebook API - 如何通过Facebook API获取Facebook用户的个人资料图像(无需用户“允许”应用程序)

更新时间:2023-12-02 16:36:58

只需通过网址获取数据:

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.