@unavatar/core 3.10.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,10 +28,12 @@
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)
34
35
  - [Telegram](#telegram)
36
+ - [Threads](#threads)
35
37
  - [TikTok](#tiktok)
36
38
  - [Twitch](#twitch)
37
39
  - [Vimeo](#vimeo)
@@ -71,10 +73,12 @@
71
73
  - [Patreon](#patreon)
72
74
  - [Printables](#printables)
73
75
  - [Reddit](#reddit)
76
+ - [Snapchat](#snapchat)
74
77
  - [SoundCloud](#soundcloud)
75
78
  - [Spotify](#spotify)
76
79
  - [Substack](#substack)
77
80
  - [Telegram](#telegram)
81
+ - [Threads](#threads)
78
82
  - [TikTok](#tiktok)
79
83
  - [Twitch](#twitch)
80
84
  - [Vimeo](#vimeo)
@@ -378,6 +382,14 @@ Available inputs:
378
382
 
379
383
  - slug, e.g., [unavatar.io/reddit/kikobeats](https://unavatar.io/reddit/kikobeats)
380
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
+
381
393
  ### SoundCloud
382
394
 
383
395
  Get any SoundCloud artist's profile picture by their username.
@@ -422,6 +434,14 @@ Available inputs:
422
434
 
423
435
  - slug, e.g., [unavatar.io/telegram/drsdavidsoft](https://unavatar.io/telegram/drsdavidsoft)
424
436
 
437
+ ### Threads
438
+
439
+ Get any Threads user's profile picture by their username.
440
+
441
+ Available inputs:
442
+
443
+ - slug, e.g., [unavatar.io/threads/zuck](https://unavatar.io/threads/zuck) or [unavatar.io/threads/@zuck](https://unavatar.io/threads/@zuck)
444
+
425
445
  ### TikTok
426
446
 
427
447
  Get any TikTok user's profile picture by their username. No authentication or API tokens needed — just pass the username.
@@ -550,4 +570,4 @@ Expected errors are known operational cases returned with stable codes.
550
570
 
551
571
  ## Contact
552
572
 
553
- If you have any suggestion or bug to report, please contact to ust mailing to [hello@unavatar.io](mailto:hello@unavatar.io).
573
+ If you have any suggestion or bug to report, please contact to ust mailing to [hello@unavatar.io](mailto:hello@unavatar.io).
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.10.0",
5
+ "version": "3.12.0",
6
6
  "main": "src/index.js",
7
7
  "exports": {
8
8
  ".": "./src/index.js",
@@ -20,10 +20,12 @@ const providersBy = {
20
20
  'pinterest',
21
21
  'printables',
22
22
  'reddit',
23
+ 'snapchat',
23
24
  'soundcloud',
24
25
  'spotify',
25
26
  'substack',
26
27
  'telegram',
28
+ 'threads',
27
29
  'tiktok',
28
30
  'twitch',
29
31
  'vimeo',
@@ -56,10 +58,12 @@ module.exports = ctx => {
56
58
  pinterest: require('./pinterest')(ctx),
57
59
  printables: require('./printables')(ctx),
58
60
  reddit: require('./reddit')(ctx),
61
+ snapchat: require('./snapchat')(ctx),
59
62
  soundcloud: require('./soundcloud')(ctx),
60
63
  spotify: require('./spotify')(ctx),
61
64
  substack: require('./substack')(ctx),
62
65
  telegram: require('./telegram')(ctx),
66
+ threads: require('./threads')(ctx),
63
67
  tiktok: require('./tiktok')(ctx),
64
68
  twitch: require('./twitch')(ctx),
65
69
  vimeo: require('./vimeo')(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
@@ -0,0 +1,13 @@
1
+ 'use strict'
2
+
3
+ const getAvatarUrl = input =>
4
+ `https://www.threads.com/${input.startsWith('@') ? input : `@${input}`}`
5
+
6
+ module.exports = ({ createHtmlProvider, getOgImage }) =>
7
+ createHtmlProvider({
8
+ name: 'threads',
9
+ url: getAvatarUrl,
10
+ getter: getOgImage
11
+ })
12
+
13
+ module.exports.getAvatarUrl = getAvatarUrl