gpt4 book ai didi

twitter - 如何在 Twitter 上获取用户的高分辨率个人资料图片?

转载 作者:行者123 更新时间:2023-12-04 10:36:07 29 4
gpt4 key购买 nike

我正在阅读 Twitter 文档 https://dev.twitter.com/overview/general/user-profile-images-and-banners并明确指出:

Alternative image sizes for user profile images You can obtain a user’s most recent profile image, along with the other components comprising their identity on Twitter, from GET users/show. Within the user object, you’ll find the profile_image_url and profile_image_url_https fields. These fields will contain the resized “normal” variant of the user’s uploaded image. This “normal” variant is typically 48px by 48px.

By modifying the URL, you can retrieve other variant sizings such as “bigger”, “mini”, and “original”. Consult the table below for more examples:

Variant Dimensions Example URL normal 48px by 48px http://pbs.twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3_normal.png https://pbs.twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3_normal.png bigger 73px by 73px http://pbs.twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3_bigger.png https://pbs.twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3_bigger.png mini 24px by 24px http://pbs.twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3_mini.png https://pbs.twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3_mini.png original original http://pbs.twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3.png https://pbs.twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3.png Omit the underscore and variant to retrieve the original image. The images can be very large.



Twitter API 的响应对于我自己的帐户是这样的:
{
....
"profile_image_url_https" = "https://pbs.twimg.com/profile_images/559415382457348097/qSYxxIAo_normal.png";
...
}

该图像 URL 有效,但它太小了。我需要可用的最高分辨率。我完全按照 Twitter 说的去做,省略了 _normal后缀,然后试试这个 URL:

https://pbs.twimg.com/profile_images/559415382457348097/qSYxxIAo.png

但是没有找到。 Twitter 文档是否已过时,或者我是否遗漏了一点?

更新:我已经尝试了一些 friend 的个人资料,其中大多数似乎都有效,并删除了任何后缀并添加了 _400x400.[jpg|png]似乎也有效,但它没有记录且不可靠,所以我真的怀疑我是否应该在生产中使用这个未记录的 API。

更新 2:我已经刷新了我的用户对象,因为 Twitter 还声明了过时的图像,但没有任何改变。

最佳答案

对我来说,“解决方法”的解决方案是从字符串的末尾删除“_normal”

看看下面:

  • 低分辨率图像:https://pbs.twimg.com/profile_images/636894769742897152/frlgaWB8_normal.jpg
  • 嗨 res 图片:
    https://pbs.twimg.com/profile_images/636894769742897152/frlgaWB8.jpg
  • 关于twitter - 如何在 Twitter 上获取用户的高分辨率个人资料图片?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34761622/

    29 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com