is there a library to fetch user avatars?

234 Views Asked by At

Let's suppose we are adding users to a platform using the email address.

Until the invited users don't upload an avatar or a profile picture, the best we can display is either a generic "user icon" or a identicon (or similar).

I assume that given the email address, there's a possibility that the user is on LinkedIN, Google plus, facebook, twitter and who knows where.

Is there a library or do you have experience in writing an algorithm that will try to fetch a profile picture from multiple channels?

--edit--

I am aware of automatically generated avatars (identicon), but what I am really trying to achieve is personal avatar that belongs to the user.

1

There are 1 best solutions below

0
On

The gravatar API is the simplest option:

http://www.gravatar.com/avatar/0123456789abcdef0123456789abcdef?s=80&d=identicon&r=g

Result:

enter image description here

The long hex number is the md5 hash of the user's email address (trimmed and lowercase). s is the avatar size.