Building Twitter profile image url with Twitter user id

前端 未结 10 1695
日久生厌
日久生厌 2020-12-04 18:06

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

10条回答
  •  南笙
    南笙 (楼主)
    2020-12-04 18:53

    Introducing the easiest way to get a Twitter Profile Image without using the Twitter API:

    Using http://avatars.io/

    As @AlexB, @jfred says, it doesn't work at all on mobile devices.

    And it's quite a hard way to get a redirected URL using common frameworks like PHP or JavaScript in your single page.

    Simply call http://avatars.io/twitter/ruucm at your image tag, like

    twt_profile
    

    I've tested it with Angular 2+ and it works without any problem.

提交回复
热议问题