I would like to use pictures from facebook if Gravatar does not have an image for the user on file. Can I do this through facebooks API?
New Profile Pic, also sometimes written as one word “NewProfilePic,” allows users to submit photos of themselves for an “AI-driven” update that makes them look like works of art.
Your current profile picture and cover photo are public, so they can be seen by anyone on or off Facebook.
Why Should You Use Gravatar? Gravatar saves you the trouble of uploading a new avatar for each blog you comment on. WordPress administrators can activate Gravatar on their sites to give commenters more brand visibility.
Take a look at the users.getInfo API method. If a user has installed your application, or "connected" to Facebook on your site through Facebook Connect, then you have access to profile information that includes versions of their profile picture.
If you don't have a session key for the user (ie, the user hasn't installed your app or connected via Facebook Connect), you can still get the "square" profile picture, which is one of the smaller versions. You can query for this directly using the API.
The easiest way overall is probably to use the fb:profile-pic tag and XFBML. You will have to install the Facebook Connect libraries to do this, but you don't need the user to log in or anything in order to get XFBML to work... as long as you have the Javascript library on the page and an API Key to use, it will work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With