使用 Twitter 用户 ID 构建 Twitter 个人资料图片 URL [英] Building Twitter profile image url with Twitter user id

查看:57
本文介绍了使用 Twitter 用户 ID 构建 Twitter 个人资料图片 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以使用用户 ID 或屏幕名称构建个人资料图片 url?我将用户 ID 存储在数据库中,但我不想存储个人资料图片 url.


我也不想进行 api 调用.我想把 user_id 放在一个像

这样的 url

<img src="https://twitter.com/users/profile_pic?user_id=123"> 有网址吗?

解决方案

通过 API 1.1,您可以使用以下 URL 实现此目的:

官方 Twitter 文档个人资料图片和横幅

示例

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:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆