加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – 获取facebook缩略图个人资料图片

发布时间:2020-12-13 13:04:47 所属栏目:PHP教程 来源:网络整理
导读:有谁知道如何使用 javascript sdk获取facebook用户的缩略图/头像? 我知道要获得全尺寸图片我可以做以下事情: //Get a list of all the albumsFB.api('/me/albums',function (response) { for (album in response.data) { // Find the Profile Picture albu
有谁知道如何使用 javascript sdk获取facebook用户的缩略图/头像?

我知道要获得全尺寸图片我可以做以下事情:

//Get a list of all the albums
FB.api('/me/albums',function (response) {
  for (album in response.data) {

    // Find the Profile Picture album
    if (response.data[album].name == "Profile Pictures") {

      // Get a list of all photos in that album.
      FB.api(response.data[album].id + "/photos",function(response) {

        //The image link
        image = response.data[0].images[0].source;

      });
    }
  }
});

不确定如何获取缩略图/头像大小.像50×50大小的东西

您也可以使用< img>使用特殊URL标记以执行相同的操作:
<img src="http://graph.facebook.com/<UID>/picture?type=square" />

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读