Zend Community   August 24, 2010   2 Comments on NP-Gravatar

Gravatar is a famous web-service for providing globally-unique avatars. Gravatar, like many other web services, has its own APIs, which are based on simple HTTP GET requests. You can find out more about those on this link.

By studying and analyzing those APIs, I come up with an idea to create a Zend Framework implementation of all those Gravatar services. That resulted in NP-Gravatar package, which will be presented in this post.

NP-Gravatar package provides classes for using and implementing Gravatar's services and features. As I did for my previous project, I hosted NP-Gravatar on Google Code and you can check it out here. Also, here is a direct link for downloading this package.

You'll find three separate components in this package, and each of them represents implementation of some Gravatar's API. Those are:


This component is a client for performing Gravatar profile requests and retrieving profile data of some Gravatar user, based on his/her primary email address. Profile data can be returned in various formats supported by Gravatar Profiles API (JSON, XML, PHP, VCF/vCard, QR Code), and some of those formats are, by default, converted to NP_Gravatar_Profile object, which represents profile data of some user in object-oriented manner.

Here are some usage examples:


This one is a client for the Gravatar XML-RPC API, which maps all methods provided by that API. Enough talk, usage examples will explain everything:


This is a simple view helper for rendering Gravatar image URLs, which follows Gravatar Image Requests API. Again, usage examples are the best way for presenting features of this component: