@unavatar/core 3.11.0 → 3.12.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/README.md CHANGED
@@ -28,6 +28,7 @@
28
28
  - [Patreon](#patreon)
29
29
  - [Printables](#printables)
30
30
  - [Reddit](#reddit)
31
+ - [Snapchat](#snapchat)
31
32
  - [SoundCloud](#soundcloud)
32
33
  - [Spotify](#spotify)
33
34
  - [Substack](#substack)
@@ -72,6 +73,7 @@
72
73
  - [Patreon](#patreon)
73
74
  - [Printables](#printables)
74
75
  - [Reddit](#reddit)
76
+ - [Snapchat](#snapchat)
75
77
  - [SoundCloud](#soundcloud)
76
78
  - [Spotify](#spotify)
77
79
  - [Substack](#substack)
@@ -380,6 +382,14 @@ Available inputs:
380
382
 
381
383
  - slug, e.g., [unavatar.io/reddit/kikobeats](https://unavatar.io/reddit/kikobeats)
382
384
 
385
+ ### Snapchat
386
+
387
+ Get any Snapchat user's profile picture by their username.
388
+
389
+ Available inputs:
390
+
391
+ - slug, e.g., [unavatar.io/snapchat/teddysdaytoday](https://unavatar.io/snapchat/teddysdaytoday) or [unavatar.io/snapchat/@teddysdaytoday](https://unavatar.io/snapchat/@teddysdaytoday)
392
+
383
393
  ### SoundCloud
384
394
 
385
395
  Get any SoundCloud artist's profile picture by their username.
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.11.0",
5
+ "version": "3.12.0",
6
6
  "main": "src/index.js",
7
7
  "exports": {
8
8
  ".": "./src/index.js",
@@ -20,6 +20,7 @@ const providersBy = {
20
20
  'pinterest',
21
21
  'printables',
22
22
  'reddit',
23
+ 'snapchat',
23
24
  'soundcloud',
24
25
  'spotify',
25
26
  'substack',
@@ -57,6 +58,7 @@ module.exports = ctx => {
57
58
  pinterest: require('./pinterest')(ctx),
58
59
  printables: require('./printables')(ctx),
59
60
  reddit: require('./reddit')(ctx),
61
+ snapchat: require('./snapchat')(ctx),
60
62
  soundcloud: require('./soundcloud')(ctx),
61
63
  spotify: require('./spotify')(ctx),
62
64
  substack: require('./substack')(ctx),
@@ -0,0 +1,13 @@
1
+ 'use strict'
2
+
3
+ const getAvatarUrl = input =>
4
+ `https://www.snapchat.com/${input.startsWith('@') ? input : `@${input}`}`
5
+
6
+ module.exports = ({ createHtmlProvider, getOgImage }) =>
7
+ createHtmlProvider({
8
+ name: 'snapchat',
9
+ url: getAvatarUrl,
10
+ getter: getOgImage
11
+ })
12
+
13
+ module.exports.getAvatarUrl = getAvatarUrl