how to add the gravatar image into our web application?


How the URL is constructed

Step 1, The URL base: A gravatar is a dynamic image resource that is requested from our server. The request URL is presented here, broken into its segments. The URL always begins with

http://www.gravatar.com/avatar/

Step 2, The email hash: The next part of the URL is the hexadecimal MD5 hash of the requested user’s lowercased email address with all whitespace trimmed, for example the fictitious “iHaveAn@email.com” would have a hash of “3b3be63a4c2a439b013787725dfce802” This may be followed by .jpg (useful for some places on the internet which require that image URLs have filename extensions)

http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802

http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802.jpg

Everything from here on… is optional

Step 3, The size: You can specify a “size” or “s” parameter to the URL between 1 and 512 (pixels.) If you omit this step we use a default size of 80 pixels.

http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802?s=80

Step 4, The rating: You can specify a “rating” or “r” parameter to the URL of g, pg, r, or x. If you omit this step we use a default rating of g.

http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802?r=g

Step 5, The default: You can specify a “default” or “d” parameter to the URL, this should be urlencoded so as to make it to our servers intact. There are “special” values that you may pass to this parameter which produce dynamic default images. These are “identicon” “monsterid” and “wavatar”. If omitted we will serve up our default image, the blue G. A new parameter, 404, has been added to allow the return of an HTTP 404 error instead of any image or redirect if an image cannot be found for the specified email address.

http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802?d=http%3A%2F%2Fexample.com%2Fimages%2Fexample.jpg

http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802?d=identicon

http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802?d=monsterid

http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802?d=wavatar

http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802?d=404