In 1.0, I could retrieve the image via GET users/profile_image/:screen_name. I don’t see a 1.1 equivalent. Help?
Would love to know the answer to this query as well. Running into this myself and wondering if the 1.0 way of grabbing a user’s profile image (bigger/normal/etc.) will stop working once 1.1 is out and 1.0 is bye-bye.
See [node:10796] for information on determining different sizes for Twitter avatars in 1.1 (and v1 for that matter).
Just what I needed, thanks.
Thank you for your post…really helped to to me
Is there a way to get it without making a whole new request, like Facebook and Google+:
twitter bad method…
@jwerre - Hey man, in order to get the original image, take the address they give you from the API call, eg. statuses.user.profile_image_url, and strip off the “_normal” from the file name. In other words,
and that’s the full sized image. Hope that helps!
Thank you very much
echo str_replace(’_normal’, ‘_bigger’,$tweet->user->profile_image_url)
In API v1.1, the Twitter docs now tell you to “modify the URL” rather than make another request to get the URL for a different image size. So basically, like @pete_klein said, take the profile_image_url from a previous API call (like get friends) and do a string replacement for “normal” to “bigger” or “normal” to “” to get larger profile images.
It feels a little sneaky, but so long as the conventions don’t change it’s one less API call for Twitter’s servers to respond to, and one less API call for your client to make.
Thnq Very very much
str_replace(’**_**normal’, ‘’, $tweet->user->profile_image_url)
Worth noting that you can also just use https://twitter.com/[screen_name]/profile_image?size=original. For instance, https://twitter.com/isaach/profile_image?size=original.
Is that an officially supported endpoint? I can’t seem to find it in the docs.
It’s not in the docs because it’s not part of the API. It’s a supported part of the twitter.com site, though.