0

Consider an application with a messaging/commenting widget. When a user posts, his/her social media profile picture is used if they've given the app authorization etc. How is it that other users can also view that same profile picture? Even at a later date?

Would I store the users social media id in a database and call the picture for other users that way? Do social media sites allow you to use basic information like profile pictures and first name etc without an actual authorization from the user once you've got the id? Or are sites saving the images and data on their own servers for later representation?

1 Answer 1

0

Twitter profile pictures are just images stored on a public server; the images themselves can be retrieved regardless of whether or not you're logged in to Twitter.

Once your user allows you to access their Twitter profile, grab the URL for the image and store it in a database. Then, when you want to display the image, call it with the image URL just like you would any other image in a web application.

3
  • Does the image url change when the user updates their picture? Does facebook allow the same sort of thing?
    – ryandlf
    Aug 15, 2014 at 19:57
  • Not sure about Facebook, but the Twitter question is easy enough for you to test with your own profile. :)
    – DWRoelands
    Aug 15, 2014 at 20:44
  • 1
    When linking to Facebook profile pictures, link to https://graph.facebook.com/<userid>/picture. This will always be the most up to date picture, even when the user changes their profile picture. Aug 16, 2014 at 23:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.