Problem

Twitter has an amazing API and a great developer ecosystem, but there is one pain point: avatars are transient. The profile_image_url attribute in the /users/show endpoint is a direct link to an S3 URL that includes the original file name. This is a problem for a number of reasons.

  • If a user uploads a new profile image with a different file name then the previous profile_image_url goes dead.
  • If your Twitter application stores older tweets and you use that older profile_image_url then your icon links are broken.

Many developers have turned to maintaining their own solutions, which is a pain. Other developers might like to use Twitter usernames similar to the way email addresses can be used with Gravatar. SOMETHING MUST BE DONE! THINK OF THE CHILDREN!

Solution

Replace your <img src="http://a3.twimg.com/profile_images/71412/Picture_bigger.png" alt="aplusk" /> with tweetimag.es URL's and we take care of showing the proper icon.

For example, to show joestump's Twitter profile icon you would simply do <img src="http://img.tweetimag.es/i/joestump_n" alt="joestump" /> in your application's HTML source.

Format: http://img.tweetimag.es/i/{username}_{size}
m (24x24) n (48x48) b (73x73) o (original size, varies)
joestump joestump joestump joestump

That's it?

That's it.


This service is provided as-is and is not warranted by anyone, anywhere, regardless of what you may think.