我不认为你可以一步到位,但你确实有几个选择:
1.
您可以指定large
获取照片时的类型参数(尽管您最多只能获取 200 像素):
http://graph.facebook.com/UID/picture?type=large
2.
您可以只获取个人资料图片专辑的封面照片 - 这始终是当前的个人资料图片:
https://graph.facebook.com/UID/albums?access_token=TOKEN
这将返回以下内容:
{
"id": "123456781234",
"from": {
"name": "FirstName Surname",
"id": "123456789"
},
"name": "Profile Pictures",
"link": "http://www.facebook.com/album.php?aid=123456&id=123456789",
"cover_photo": "12345678912345123",
"privacy": "friends",
"count": 12,
"type": "profile",
"created_time": "2000-01-23T23:38:14+0000",
"updated_time": "2011-06-15T21:45:14+0000"
},
然后您可以访问:
https://graph.facebook.com/12345678912345123?access_token=TOKEN
并选择图像尺寸:
{
"id": "12345678912345123",
"from": {
"name": "FirstName Surname",
"id": "123456789"
},
"name": "A Caption",
"picture": "PICTUREURL",
"source": "PICTURE_SRC_URL",
"height": 480,
"width": 720,
"images": [
{
"height": 608,
"width": 912,
"source": "PICTUREURL"
},
{
"height": 480,
"width": 720,
"source": "PICTUREURL"
},
{
"height": 120,
"width": 180,
"source": "PICTUREURL"
},
{
"height": 86,
"width": 130,
"source": "PICTUREURL"
},
{
"height": 50,
"width": 75,
"source": "PICTUREURL"
}
],
"link": "FACEBOOK_LINK_URL",
"icon": "FACEBOOK_ICON_URL",
"created_time": "2000-01-15T08:42:42+0000",
"position": 1,
"updated_time": "2011-06-15T21:44:47+0000"
}
并选择您PICTUREURL
的选择。
3.
由本博客提供:
//get the current user id
FB.api('/me', function (response) {
// the FQL query: Get the link of the image, that is the first in the album "Profile pictures" of this user.
var query = FB.Data.query('select src_big from photo where pid in (select cover_pid from album where owner={0} and name="Profile Pictures")', response.id);
query.wait(function (rows) {
//the image link
image = rows[0].src_big;
});
});
我在引用时不相信,但在玩测试样本时,我确实提出了基本相同的 FQL 查询。当我在谷歌上搜索时,这个家伙刚刚击败了我FB.Data.query
。我想你必须将它编辑到 python 中,如果你想要它在 python 中,那么我可以挖掘。