Getting the profile picture for an email address via gravatar!!
A Gravatar is a picture associated with an email address. It is a brilliant system that allows anyone anywhere to create a photo to be associated with an email address they have (gravatar.com verifies the email address before allowing them to edit the picture). And then makes this photo publicly accessible to anyone! (See: http://en.gravatar.com/site/implement/hash/) for full details).
All you do to get the image associated with an email address is compose a url.
Just take the email address, trim any whitespace off the ends, make it all lower case, md5 it, and the url is:
http://www.gravatar.com/avatar/hash
So, php code to do this is:
$emailAddress = 'Bob.cOOl@example.com'; $url = 'http://www.gravatar.com/avatar/' . md5(strtolower(trim($emailAddress)));
You can also add a size parameter to the url to get a specific size… i.e.
$emailAddress = 'Bob.cOOl@example.com'; $size = 177; $url = 'http://www.gravatar.com/avatar/' . md5(strtolower(trim($emailAddress))) . '?size=' . $size;
Awesome huh?
Check out this link for more you can do: http://en.gravatar.com/site/implement/hash/