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

adi*_*dit 7 javascript php facebook facebook-javascript-sdk

有谁知道如何使用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;

      });
    }
  }
});
Run Code Online (Sandbox Code Playgroud)

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

Jim*_*zuk 25

您也可以使用<img>带有特殊URL 的标记来执行相同的操作:

<img src="http://graph.facebook.com/<UID>/picture?type=square" />
Run Code Online (Sandbox Code Playgroud)