@unavatar/core 3.28.0 → 3.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/providers/codepen.js +12 -0
- package/src/providers/dockerhub.js +19 -0
- package/src/providers/index.js +4 -0
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@unavatar/core",
|
|
3
3
|
"description": "Get unified user avatar from social networks, including Instagram, SoundCloud, Telegram, Twitter, YouTube & more.",
|
|
4
4
|
"homepage": "https://unavatar.io",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.30.0",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./src/index.js",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const getAvatarUrl = input => `https://codepen.io/${input}`
|
|
4
|
+
|
|
5
|
+
module.exports = ({ createHtmlProvider, getOgImage }) =>
|
|
6
|
+
createHtmlProvider({
|
|
7
|
+
name: 'codepen',
|
|
8
|
+
url: getAvatarUrl,
|
|
9
|
+
getter: getOgImage
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
module.exports.getAvatarUrl = getAvatarUrl
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const API_URL = 'https://hub.docker.com/v2/users'
|
|
4
|
+
|
|
5
|
+
const getUserUrl = input => `${API_URL}/${encodeURIComponent(input)}/`
|
|
6
|
+
|
|
7
|
+
module.exports = ({ got }) =>
|
|
8
|
+
async function dockerhub (input) {
|
|
9
|
+
const { body, statusCode } = await got(getUserUrl(input), {
|
|
10
|
+
responseType: 'json',
|
|
11
|
+
throwHttpErrors: false
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
if (statusCode >= 400) return
|
|
15
|
+
|
|
16
|
+
return body?.gravatar_url || undefined
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
module.exports.getUserUrl = getUserUrl
|
package/src/providers/index.js
CHANGED
|
@@ -8,9 +8,11 @@ const providersBy = {
|
|
|
8
8
|
'behance',
|
|
9
9
|
'bluesky',
|
|
10
10
|
'buymeacoffee',
|
|
11
|
+
'codepen',
|
|
11
12
|
'cults3d',
|
|
12
13
|
'deviantart',
|
|
13
14
|
'discord',
|
|
15
|
+
'dockerhub',
|
|
14
16
|
'dribbble',
|
|
15
17
|
'facebook',
|
|
16
18
|
'flickr',
|
|
@@ -57,9 +59,11 @@ module.exports = ctx => {
|
|
|
57
59
|
behance: require('./behance')(ctx),
|
|
58
60
|
bluesky: require('./bluesky')(ctx),
|
|
59
61
|
buymeacoffee: require('./buymeacoffee')(ctx),
|
|
62
|
+
codepen: require('./codepen')(ctx),
|
|
60
63
|
cults3d: require('./cults3d')(ctx),
|
|
61
64
|
deviantart: require('./deviantart')(ctx),
|
|
62
65
|
discord: require('./discord')(ctx),
|
|
66
|
+
dockerhub: require('./dockerhub')(ctx),
|
|
63
67
|
dribbble: require('./dribbble')(ctx),
|
|
64
68
|
duckduckgo: require('./duckduckgo')(ctx),
|
|
65
69
|
facebook: require('./facebook')(ctx),
|