Integrating DoppelMe Avatar Images
This is the easiest and fastest way to add DoppelMe avatars to your website.
- Your users need to supply you with their DoppelMe Key (a DoppelMe Key looks something like DM123456ABC. It will never be longer than 20 characters) which you should save along with your users details.
- If a user does not already have a DoppelMe, then you need to instruct them to visit www.doppelme.com to create their own avatar and receive their Key. They should then supply this key to you which you should store for them.
- Wherever you wish to show their avatar you can do so in your website by programmatically creating the appropriate image link.
<img src="http://www.doppelme.com/DM123456ABC/avatar.png" border="0">You can show a cropped version of their avatar
<img src="http://www.doppelme.com/DM123456ABC/crop.png" border="0">And resize as necessary
<img src="http://www.doppelme.com/80/DM123456ABC/crop.png" border="0">You can also change the background of the avatar by either adding the 6 character RGB colour or TRANSPARENT as part of the image tag.
<img src="http://www.doppelme.com/FFFFFF/80/DM123456ABC/crop.png">(this sets a background colour or makes it transparent. This will override any backgrounds that the users has saved with their avatar)
As with all user supplied information, please remember to strip out any HTML characters from keys supplied by your users before displaying it as part of an img tag above. More examples of how you can manipulate the avatar images can be found on the DoppelMe Website
Avatars From Email AddressesYou can get a user's primary avatar using just their email address. In order to protect their privacy, you need to one-way hash the email address (lowercase only) using md5 and prefix with the code, EH.
Below is an example in PHP.
<?php $doppelme_id = 'EH' . md5( strtolower($email) ); echo '<img src="http://www.doppelme.com/TRANSPARENT/80/' . $doppelme_id . '/crop.png">' ?>