SPIURL – Static Profile Image Urls for Twitter
I love the Twitter service and its API, but there are times when a few workarounds are necessary. Currently, whenever a Twitter user changes his or her profile picture, the link to the picture changes, breaking the old link. This can occur several times a day for many users (not to name any names – @pprlisa, @mediaphyter…). For external developers, this can be quite a problem. We either have to cache the images through our services, or perform constant lookups against Twitter (not good for the API).
Twitter is aware of the issue and I hope they’ll eventually rollout static profile image links. In the meantime, I’ve developed a solution that anyone can use. Developers can either code against my service or download the code and implement it themselves.
SPIURL is a Google App Engine project that stores the current profile image url in the Google datastore, keyed by screen name. If the profile image url for a user changes, the datastore will update automatically.
You can easily reference an image using the following syntax:
http://purl.org/net/spiurl/{screen_name}
In an application, you can use a SPIURL link as an image source:
<img src="http://purl.org/net/spiurl/{screen_name}" alt="Twitter User" />
Pros:
- I’m using a permanent url at purl.org to reduce the direct dependence on Google. If something happens and I have to move off of Google or I need to hand it off to another developer, the links can still work.
- It’s simple. No need to make an API call to get the current image. Just use the link and it will update on its own.
Cons:
- You’re relying on some guy (me) to make sure this thing works. (Although I don’t think I’ll need to make any additional code changes.)
- Something might go wrong – Perhaps I’ll hit a Google datastore or bandwidth limit. (not likely, but it’s a risk).
- It’s slower. Yes, it takes a few extra beats for the images to display vs. a direct call to Amazon. The more images you display on a page, the more obvious the delay. I have it running on My Tweeple and I think the performance is fine.
If you don’t want to rely on SPIURL, you can always download the code and implement your own version. It’s entirely up to you.
While it’s true that Twitter might rollout this feature next week and this would all be for naught, I don’t mind. Code is Poetry and Programming is Fun. Enjoy.
data-text=”SPIURL – Static Profile Image Urls for Twitter (Shannon Whitley)”
data-count=”vertical”
>Tweet
7 Responses to “SPIURL – Static Profile Image Urls for Twitter”
Leave a Reply
10 Trackbacks
- swhitley (Shannon Whitley)
Twitter Devs: Static Profile Image Urls [update] – [link to post] – Now with more geeky goodness baked right in.– Posted using Chat Catcher
- kr8tr (Rob La Gesse)
Retweet @swhitley: Twitter Devs: Static Profile Image Urls [update] – [link to post] – Now with more geeky goodness baked right in.– Posted using Chat Catcher
- TwitLinksRSS (TwitLinksRSS)
SPIURL – Static Profile Image Urls for Twitter | Shannon Whitley: I love the Twitter service and its API, but th.. [link to post]– Posted using Chat Catcher
- TweetingBird (Tweeting Bird)
SPIURL – Static Profile Image Urls for Twitter | Shannon Whitley [link to post]– Posted using Chat Catcher
- HuMBush (Heather M Bush)
@swhitley Thanx!! I’ve been probing your site [link to post] ~ wondering how I could have missed that!! =}– Posted using Chat Catcher
- Online Aspect » Blog Archive » Permanent links to profile pictures on twitter
[...] that Shannon Whitley started that provides a simple solution for the roaming profile picture.
- VirtualLee (Barbara McMillen)
[link to post] re: photo– Posted using Chat Catcher
- Flash Builder 4でSocial Spring Graph « kwLog
[...] twitter APIを経由していないため、profileアイコンが取得できていなかった。仮に実装するとしてもSocialGraph APIから取得できた一人ひとりのprofileをtwitter APIへリクエストするのはあまりにも無駄なので以下のtwitterアカウントからprofile画像のurlにリダイレクトしてくるGAEなサービスを拝借。 http://www.voiceoftech.com/swhitley/?p=652 [...]
- sindyjlee (Sindy J. Lee)
Super useful (don’t know why Twitter hasn’t done this themselves)– Static Profile Image Urls from Shannon Whitley: [link to post] - sindylee.com » Blog Archive » Getting Twitter Profile Image URLs
[...] take it back– I still love Shannon Whitley’s SPIURL, but apparently, Twitter does have a static link for profile images. Almost all of the Google [...]

Twitter Comment
Twitter Devs: Static Profile Image Urls [update] – [link to post] – Now with more geeky goodness baked right in.
– Posted using Chat Catcher
Twitter Comment
Retweet @swhitley: Twitter Devs: Static Profile Image Urls [update] – [link to post] – Now with more geeky goodness baked right in.
– Posted using Chat Catcher
Twitter Comment
SPIURL – Static Profile Image Urls for Twitter | Shannon Whitley: I love the Twitter service and its API, but th.. [link to post]
– Posted using Chat Catcher
Twitter Comment
SPIURL – Static Profile Image Urls for Twitter | Shannon Whitley [link to post]
– Posted using Chat Catcher
Twitter Comment
@swhitley Thanx!! I’ve been probing your site [link to post] ~ wondering how I could have missed that!! =}
– Posted using Chat Catcher
[...] that Shannon Whitley started that provides a simple solution for the roaming profile picture.
Twitter Comment
[link to post] re: photo
– Posted using Chat Catcher
SPIURL is brilliant and sure saves me a lot of work at Topify, so just wanted to say a big THANK YOU !
Shannon – Giant thanks for the service. It rocks! We’ve been noticing lately that some users are having old profile images from months ago coming back from SPIURL – Any ideas?
Wow! Thank you so much for doing this
Sweet stuff. Thanks a whole lot for this. Made my life 10x easier.
SPIURL did not work wit buddypress chat.
header error
[...] twitter APIを経由していないため、profileアイコンが取得できていなかった。仮に実装するとしてもSocialGraph APIから取得できた一人ひとりのprofileをtwitter APIへリクエストするのはあまりにも無駄なので以下のtwitterアカウントからprofile画像のurlにリダイレクトしてくるGAEなサービスを拝借。 http://www.voiceoftech.com/swhitley/?p=652 [...]
I’m so thankful for this post! We’ve been looking to incorporate Twitter more into the site and this info is just what the doctor ordered!
Thanks!
This is super handy. Thanks a lot!
Twitter Comment
Super useful (don’t know why Twitter hasn’t done this themselves)– Static Profile Image Urls from Shannon Whitley: [link to post]
– Posted using Chat Catcher
[...] take it back– I still love Shannon Whitley’s SPIURL, but apparently, Twitter does have a static link for profile images. Almost all of the Google [...]