<p>我认为你不能一步到位,但你有几个选择:</p>
<p><strong>1.</strong></p>
<p>当您获得照片时,可以指定类型参数<code>large</code>(尽管您最多只能得到200px):</p>
<p><code>http://graph.facebook.com/UID/picture?type=large</code></p>
<p><strong>2.</strong></p>
<p>您只需获取个人资料图片相册的封面照片—它始终是当前的个人资料图片:</p>
<p><code>https://graph.facebook.com/UID/albums?access_token=TOKEN</code></p>
<p>它将返回如下内容:</p>
<pre><code>{
"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"
},
</code></pre>
<p>然后您可以访问:</p>
<p><code>https://graph.facebook.com/12345678912345123?access_token=TOKEN</code></p>
<p>并选择图像大小:</p>
<pre><code>{
"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"
}
</code></pre>
<p>选择你的选择。</p>
<p><strong>3.</strong></p>
<p>由<a href="http://kilianvalkhof.com/2011/javascript/full-size-profile-picture-via-the-facebook-javascript-sdk/" rel="noreferrer">this blog</a>提供:</p>
<pre><code>//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;
});
});
</code></pre>
<p>我不相信引用,但我确实在处理测试样本时提出了基本相同的FQL查询。我在网上搜索时,这家伙把我揍了一顿。我想你将不得不在python中编辑它,如果你想在python中编辑它,那么我可以四处挖掘。</p>