Comparing version 0.0.3 to 0.0.4
@@ -63,5 +63,6 @@ const async = require('async') | ||
const avatarUrl = googleAvatarApi + email + '?alt=json' | ||
request({ | ||
method: 'GET', | ||
uri: avatarUrl, | ||
url: avatarUrl, | ||
gzip: true | ||
@@ -83,8 +84,14 @@ }, (e, r, response) => { | ||
fethGravatarImage (email, callback) { | ||
const avatar = gravatar.url(email, { s: '100', r: 'x', d: '404' }) | ||
const gravatarUrl = gravatar.url(email, { protocol: 'https', s: '100', r: 'x', d: '404' }) | ||
if (avatar.includes('d=404')) { | ||
return callback(new Error('Gravatar not found'), null) | ||
} | ||
callback(null, avatar) | ||
request({ | ||
method: 'GET', | ||
url: gravatarUrl, | ||
format: 'json' | ||
}, (e, r, response) => { | ||
if (response === '404 Not Found') { | ||
return callback(null, null) | ||
} | ||
return callback(null, gravatarUrl) | ||
}) | ||
} | ||
@@ -91,0 +98,0 @@ |
{ | ||
"name": "avatar-me", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Simple node module to retrieves a user avatar given an email or a user name Edit", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5216
94