Gravitate
Yet another node library for Gravatar with support for both the photo and profile APIs.
Hash
Although all of the gravitate functions can accept an email, there is still a hash function available for your use. If the input has already been hashed then it will just return the value.
var gravitate = ;var email = 'email@address.com';var hash = gravitatehashemail; // "63b91ca4ec19ad79f320eaf5815d75e9"
ignorePlus - Ignore characters after and including a + sign. Defaults to true
.
Images
var hash = '63b91ca4ec19ad79f320eaf5815d75e9';var imageUrl = gravitateimage; // "https://secure.gravatar.com/avatar/63b91ca4ec19ad79f320eaf5815d75e9"
All functions also accept an email:
var email = 'email@address.com';var imageUrl = gravitateimage; // "https://secure.gravatar.com/avatar/63b91ca4ec19ad79f320eaf5815d75e9"
Image and profile urls are secure by default. You can toggle SSL by setting the secure property in options to true or false.
var email = 'email@address.com';var imageUrl = gravitateimage; // "http://www.gravatar.com/avatar/63b91ca4ec19ad79f320eaf5815d75e9"
All of the standard url options are also available either through their full or abbreviated name:
var email = 'email@address.com';var imageUrl = gravitateimage;
Profiles
Profile urls work the same way as image urls and also accept a secure parameter:
var email = 'email@address.com';var profileUrl = gravitateprofile; // "https://secure.gravatar.com/63b91ca4ec19ad79f320eaf5815d75e9.json"
Often times you'll want the actual data and not url. You can get the profile data with the following function:
var email = 'email@address.com';var profileUrl = gravitateprofiledataemail { if err return; console; // {hash: '...', photos: [], ...}};