使用 Twitter 用户 ID 构建 Twitter 个人资料图片 URL [英] Building Twitter profile image url with Twitter user id
问题描述
有什么方法可以使用用户 ID 或屏幕名称构建个人资料图片 url?我将用户 ID 存储在数据库中,但我不想存储个人资料图片 url.
我也不想进行 api 调用.我想把 user_id 放在一个像
<img src="https://twitter.com/users/profile_pic?user_id=123">
有网址吗?
通过 API 1.1,您可以使用以下 URL 实现此目的:
- https://twitter.com/[screen_name]/profile_image?size=迷你
- https://twitter.com/[screen_name]/profile_image?size=正常
- https://twitter.com/[screen_name]/profile_image?size=更大
- https://twitter.com/[screen_name]/profile_image?size=原创
示例
https://twitter.com/TwitterEng/profile_image?size=original
<块引用>
将重定向到
https://pbs.twimg.com/profile_images/875168599299637248/84CkAq6s.jpg
Is there any way of building a profile image url with user id or screen name? I store user ids in database but i don't want to store profile image url.
edit:
I don't want to make a api call too. I want to put user_id inside a url like
<img src="https://twitter.com/users/profile_pic?user_id=123">
Is there a url to do this?
With API 1.1 you can achieve this using these URLs:
- https://twitter.com/[screen_name]/profile_image?size=mini
- https://twitter.com/[screen_name]/profile_image?size=normal
- https://twitter.com/[screen_name]/profile_image?size=bigger
- https://twitter.com/[screen_name]/profile_image?size=original
Official twitter documentation Profile Images and Banners
Example
https://twitter.com/TwitterEng/profile_image?size=original
will redirect to
https://pbs.twimg.com/profile_images/875168599299637248/84CkAq6s.jpg
这篇关于使用 Twitter 用户 ID 构建 Twitter 个人资料图片 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!