<p>我正在使用Facebook图形API。</p>
<p>我想下载所有用户Facebook个人资料图片的全尺寸图片。</p>
<p><code>https://graph.facebook.com/<user alias>/picture</code>允许您访问用户当前配置文件图片的缩略图。</p>
<p>如果我想下载用户的全尺寸个人资料照片,看起来我需要在这个伪代码中做类似的事情。。。</p>
<pre><code># Get albums
albums = fetch_json('https://graph.facebook.com/<user alias>/albums')
# Get profile pictures album
profile_picture_album = albums['data']['Profile Pictures'] # Get profile picture album
# Get the pictures from that album
profile_pictures = fetch_json('https://graph.facebook.com/<profile_picture_album_id>/photos')
# Get the most recent (and therefore current) profile picture
current_profile_picture = profile_pictures['data'][0]
image = fetch_image_data(current_profile_picture['source'])
</code></pre>
<p>问题是,这需要两个不同的API访问,然后需要<em>然后</em>图像下载。如果相册中有很多相册或图片,我需要处理分页。</p>
<p>似乎应该有一种更快/更简单的方法来访问用户当前的个人资料图片。有人知道吗?</p>
<p>(仅供参考:我碰巧使用了Python来实现这一点,但我认为答案是语言不可知的)</p>