> I want to use users/profile_image/twitter to get the picture of a
> Twitter account. But I've seen the biggest size allowed is 73*73px. Is
> there a way to get the original picture or a bigger one ?

Avatars come in three sizes:

        mini = 24x24
        normal = 48x48
        bigger = 73x73
        reasonably_small = 128x128

The last one only started being used with #NewTwitter so unless
someone has uploaded an avatar since then, you'll get the "bigger" one
instead.  To get the alternate sizes, just replace the "_normal" with
the desired size.  For my avatar these are the urls:

http://a3.twimg.com/profile_images/361706538/mk1_mini.jpg
http://a3.twimg.com/profile_images/361706538/mk1_normal.jpg
http://a3.twimg.com/profile_images/361706538/mk1_bigger.jpg
http://a3.twimg.com/profile_images/361706538/mk1_reasonably_small.jpg

Since sometimes people change the avatar and the one you might have on
file is now dead, I use spiurl as a backup source for images
http://code.google.com/p/spiurl/ which downloads and caches images
from Twitter and runs on google's AppSpot (you can clone your own if
you want control)  The SPIURLs look like this:

http://purl.org/net/spiurl/IDisposable/normal

I've got it doing automatic fallback like this (and handling error
from there with a fallback to my own locally cached default images):

<img alt="IDisposable" width="48" height="48" src="http://a3.twimg.com/
profile_images/361706538/mk1_normal.jpg" title="IDisposable"
onerror="avatarOnError(this, 'normal');">

// Common.js
// must be setup very early to guarantee it is available before any
images try loading.
avatarOnError = function(img, size) {
    var profileName = img.title;
    size = size || "normal";
    img.src = 'http://purl.org/net/spiurl/' + profileName + '/' +
size;
    img.onerror = function() {
        this.onerror = undefined;
        this.src = '/Assets/images/twitter/default_profile_' +
Math.floor(Math.random() * 7) + '_' + size + '.png';
    }
}

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk

Reply via email to