私はあなたが1つの素晴らしいステップでそれを行うことができるとは思いませんが、あなたにはいくつかの選択肢があります:
1.1。
large
写真を取得するときのtype引数を指定できます(ただし、最大200pxしか取得できません)。
http://graph.facebook.com/UID/picture?type=large
2.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.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で望むなら、私は掘り下げることができます。