How To Fix Broken Twitter Profile Pics In Your App

tweetimages IconIf you work on 3rd-party tools built over Twitter’s API and have noticed a problem with the URLs of updated profile pics, tweetimages now offers a solution to the problem. According to the tweetimages website, the problem lies in the in the profile_image_url attribute of a user’s profile because it links to an Amazon S3 URL, which changes if a user updates their Twitter profile image. While the Twitter website itself handles any profile pic updates, 3rd-party tools sometimes retain older pic URLs. Tweetimages offers a simple solution so that developers don’t have to come up with their own.

Tweetimages is the creation of Joe Stump, former lead architect at Digg (try the new Digg iPhone app). The usage is very simple, and the web service is provided as is, with no warranties or support (hosting is courtesy of Media Temple). What tweetimages does is provide a single, persistent URL for Twitter profile icons that works regardless of profile pic updates (provided that the tweetimages service stays up). What’s more, you can control the profile pic icon size displayed. Using the single, lowercase letters m (24x24px), b (48×48), and o (73×73), you can determine which size you’d like to use within the following URL template:{username}_{size}

So for example, if you want to always display the current 73×73 profile pic for Social Times editor Nick O’Neill’s Twitter account (@allnick), the URL would usually be:

Using tweetimages, it would now be:

So use the tweetimages URL in your img HTML tags, to avoid the possibility of broken Twitter profile icons. (The old S3 link is replaced and ceases to exist when a profile pic is updated.)

Note: Joe Stump is also cofounder and CTO of SimpleGeo, a company who offers developer infrastructure to developers of location-based social networking and gaming applications. SocialTimes will have upcoming developer posts on “location” concepts.