george161089
george161089

Reputation: 1

Get Twitter profile image

I am making an iPhone application and need to integrate Twitter in it. I am done with the authentication part, I can post messages but I am not able to retrieve the profile image. Do you have any ideas how this could be accomplished?

Thank you a lot! George

Upvotes: 0

Views: 2798

Answers (2)

donkim
donkim

Reputation: 13137

I haven't used MGTwitterEngine so I can't speak to how to use it to grab a profile image, but it looks like you can get it fairly easily using the Twitter API. Here's how I would grab my own profile image:

Make a call to http://api.twitter.com/1/statuses/user_timeline.json?user_id=3257861 (replace the user_id with whoever's profile image it is you want)

Using a JSON framework (I've been using this), parse the response.

For each tweet in the JSON array, there's a key called profile_image_url which holds the profile image.

Hope this helps!

EDIT: Actually, there's a MUCH easier way. Just call this URL http://api.twitter.com/1/users/profile_image/3257861.json, it'll return the profile image. You can read more about it here. I'm leaving the rest up there just for reference (or another way of doing it, albeit not the best way)

Upvotes: 4

Ole Begemann
Ole Begemann

Reputation: 135578

Use the verrify_credentials API call.

Upvotes: 1

Related Questions