Is there a quick way to pull twitter profile image in PHP or Javascript? I need to get the url of the FULL image (not avatar size). Thanks. Any code sample is good.
When you get original image link, you can modify it to get bigger. http://pbs.twimg.com/profile_images/34543543/image_name_normal.jpg
becomes
http://pbs.twimg.com/profile_images/34543543/image_name.jpg or image_name_bigger, ...
Source: https://dev.twitter.com/docs/user-profile-images-and-banners
function get_big_profile_image($username, $size = '') {
$api_call = 'http://twitter.com/users/show/'.$username.'.json';
$results = json_decode(file_get_contents($api_call));
return str_replace('_normal', $size, $results->profile_image_url);
}
get_big_profile_image('bobsaget', '_bigger') should return a large avatar: http://a1.twimg.com/profile_images/330305510/n229938150541_9850_bigger.jpg
get_big_profile_image('bobsaget') should return an even larger image: http://a1.twimg.com/profile_images/330305510/n229938150541_9850.jpg