There is a simple way with php, a simple script or URL manipulation to build a URL for the gravatar image corresponding to an email?
Ex. http://gravatar.com/avatars/[email protected]
and this return a jpeg or png image.
If there is no simple way like the example, what is the easiest way you know to resolve a url of the gravatar corresponding to an email?. Thanks
This URL enables you to link to a Gravatar image using the encoded email address of the Gravatar account. However, you need to MD5 hash the email address for the Gravatar account to get the hash. All Gravatar URL's are based on the use of the hashed value of an email address.
Gravatar Profile Search – Search for Gravatar by Email If you want to look up your own Gravatar image (or someone else's image), there's a Gravatar profile search feature that lets you look up someone's profile picture by entering their email address.
What is Gravatar? Gravatar is a free service used to manage one's avatars on the web and allows Internet users to have “an effortless and verified way to establish their identity online”, as stated on its official website. Websites and other services can use these avatars to “humanize” their platforms a little more.
The root script is at http://www.gravatar.com/avatar/ The next part of the URL is the hexadecimal MD5 hash of the requested user's lowercased email address with all whitespace trimmed. You may add the proper file extension, but it's optional.
The complete API is here http://en.gravatar.com/site/implement/
Use this:
$userMail = whatever_to_get_the_email;
$imageWidth = '150'; //The image size
$imgUrl = 'http://www.gravatar.com/avatar/'.md5($userMail).'fs='.$imageWidth;
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