A Java class for building Gravatar Image URLs
Java
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
javadoc
src/org/asaph/gravatar
test/org/asaph/gravatar
LICENSE
README.md
build.properties
build.xml
gravatar4j-1.0.zip
gravatar4j.jar

README.md

A class for building Gravatar URLs based on the Gravatar implementation guide.

Sample usage: The following code prints out the URL to the Gravatar image based on the supplied email address:

GravatarUrl gravatarUrl = new GravatarUrl("iHaveAn@email.com");
System.out.println(gravatarUrl);

The above code outputs:

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

The optional size, rating and default icon settings are also supported. Constants for rating and default icon are provided for convenience.

GravatarUrl gravatarUrl = new GravatarUrl("iHaveAn@email.com", 512, GravatarUrl.Rating.PG, GravatarUrl.DEFAULT_ICON_IDENTICON);
System.out.println(gravatarUrl);

The above code outputs:

http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802.jpg?s=512&r=pg&d=identicon