我不認爲你可以在一個很好的一步做,但你有幾個選項:
,當你的照片(雖然你只能得到最多200像素),您可以指定large
類型參數:
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
。
的this blog禮貌:
//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,那麼我可以挖掘它。
不錯! 200px one *可能足以滿足我的目的,但除此之外,我會嘗試FQL查詢(我將弄清python,不用擔心。)謝謝! –
好吧,問問你是否需要澄清! – BeRecursive
僅供參考,我最終使用了200px'type = large'解決方案,但是非常感謝您的回答! –