Getting full-size profile picture

后端 未结 7 1949
我寻月下人不归
我寻月下人不归 2020-11-30 19:40

Is there anyway to get the full-size profile picture using any facebook api?

http://graph.facebook.com/{ID}/picture?type=large is way to small.

Thanks :)

7条回答
  •  执念已碎
    2020-11-30 20:19

    With Javascript you can get full size profile images like this

    pass your accessToken to the getface() function from your FB.init call

    function getface(accessToken){
      FB.api('/me/friends', function (response) {
        for (id in response.data) { 
            var homie=response.data[id].id         
            FB.api(homie+'/albums?access_token='+accessToken, function (aresponse) {
              for (album in aresponse.data) {
                if (aresponse.data[album].name == "Profile Pictures") {                      
                  FB.api(aresponse.data[album].id + "/photos", function(aresponse) {
                    console.log(aresponse.data[0].images[0].source); 
                  });                  
                }
              }   
            });
        }
      });
    }
    

提交回复
热议问题