- May 24, 2009
- 427
- 467
- 47
- Home Country
- Israel
- Moderator
- #41
Hi yoavain, is this something universal or documented? Even tho it seems like a good thing to do, personally I wouldn't like IF:
- half of profile images will be missing after the change - has to be tested on large sample
- twitter changes this in the future and all profile images are missing - if it's undocumented feature, change can be made without any announcements
But perhaps I'm just too worried about a small change like this But would still like to hear edsche's comments.
Hmm, I see your point.
Here's what I found in Twitter API documentation:
GET users/profile_image/:screen_name | dev.twitter.com
According to that, you can use the following options (for example, with the user "teammediaportal")
http://api.twitter.com/1/users/profile_image/teammediaportal.xml
http://api.twitter.com/1/users/profile_image/teammediaportal.xml?size=normal
http://api.twitter.com/1/users/profile_image/teammediaportal.xml?size=bigger
http://api.twitter.com/1/users/profile_image/teammediaportal.xml?size=mini
And here's the one they do not document:
http://api.twitter.com/1/users/profile_image/teammediaportal.xml?size=original
IMO, the one they don't document is still valid, since anything else gives back:
HTML:
<errors>
<error code="24">Unsupported profile image size</error>
</errors>
Anyway, we can always do this:
1. Try to get the original (biggest)
2. If we get an error return code, try to get "bigger"
3, If we get an error return code, try to get "normal"
But I'm pretty confident 1. will work great.
By the way, I got the idea from the well known HoverZoom Chrome Extension...
,
Yoav