如何从 FQL 获取 100x100px 和 200x200px 个人资料图片?
我正在使用此 fql 查询,这为我提供了用户朋友的 50x50px 个人资料图片,
$FQLQuery = 'SELECT uid,sex,pic_square FROM user WHERE uid in (SELECT uid2 FROM friend WHERE uid1 = me())';
我想仅使用 fql 获得 100x100px 或 200x200px。
我怎样才能得到那个?
i am using this fql query this gives me 50x50px profile pic of user's friend
$FQLQuery = 'SELECT uid,sex,pic_square FROM user WHERE uid in (SELECT uid2 FROM friend WHERE uid1 = me())';
i want to get 100x100px or 200x200px by using fql only.
how i can get that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我通过以下方式使用图形 API 获取头像
,然后使用 GD 库获取该图像并保存在磁盘上。这样你就可以得到任何你喜欢的矩形头像图像的大小。
I get the avatar using graph API by the following
and then I use GD library to get this image and save on disk. This way you can get whatever size you like of the rectangle avatar image.
根据文档,你不能。您必须获取一张较大的图像(也许是
pic_big
),然后用 PHP 自己将其变成一个正方形。According to documentation you can't. You will have to fetch one of the bigger images (
pic_big
maybe), and then make it into a square yourself with PHP.您只需要朋友的 Facebook ID、通过 CURL 获取的个人资料图片或 < a href="https://www.php.net/manual/en/function.file-get-contents.php" rel="nofollow noreferrer">file_get_contents 来自 URL:
https://graph.facebook.com/FRIEND_ID/picture?type=normal< br>
支持的类型:小型、普通、大型、方形
You need only friends Facebook ids, profile images get by CURL or file_get_contents from URL:
https://graph.facebook.com/FRIEND_ID/picture?type=normal
Supported types: small, normal, large, square
由于这是搜索“fql square pic”时的第一个结果,因此我想指出,您现在可以选择 pic_square 字段来获取 50x50 版本的用户个人资料图片。
Since this is the first result when searching for "fql square pic", I would like to point out that you can now select the pic_square field to get a 50x50 version of the user's profile picture.