@unavatar/core 3.10.0 → 3.11.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
@@ -32,6 +32,7 @@
32
32
  - [Spotify](#spotify)
33
33
  - [Substack](#substack)
34
34
  - [Telegram](#telegram)
35
+ - [Threads](#threads)
35
36
  - [TikTok](#tiktok)
36
37
  - [Twitch](#twitch)
37
38
  - [Vimeo](#vimeo)
@@ -75,6 +76,7 @@
75
76
  - [Spotify](#spotify)
76
77
  - [Substack](#substack)
77
78
  - [Telegram](#telegram)
79
+ - [Threads](#threads)
78
80
  - [TikTok](#tiktok)
79
81
  - [Twitch](#twitch)
80
82
  - [Vimeo](#vimeo)
@@ -422,6 +424,14 @@ Available inputs:
422
424
 
423
425
  - slug, e.g., [unavatar.io/telegram/drsdavidsoft](https://unavatar.io/telegram/drsdavidsoft)
424
426
 
427
+ ### Threads
428
+
429
+ Get any Threads user's profile picture by their username.
430
+
431
+ Available inputs:
432
+
433
+ - slug, e.g., [unavatar.io/threads/zuck](https://unavatar.io/threads/zuck) or [unavatar.io/threads/@zuck](https://unavatar.io/threads/@zuck)
434
+
425
435
  ### TikTok
426
436
 
427
437
  Get any TikTok user's profile picture by their username. No authentication or API tokens needed — just pass the username.
@@ -550,4 +560,4 @@ Expected errors are known operational cases returned with stable codes.
550
560
 
551
561
  ## Contact
552
562
 
553
- If you have any suggestion or bug to report, please contact to ust mailing to [hello@unavatar.io](mailto:hello@unavatar.io).
563
+ 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.11.0",
6
6
  "main": "src/index.js",
7
7
  "exports": {
8
8
  ".": "./src/index.js",
@@ -24,6 +24,7 @@ const providersBy = {
24
24
  'spotify',
25
25
  'substack',
26
26
  'telegram',
27
+ 'threads',
27
28
  'tiktok',
28
29
  'twitch',
29
30
  'vimeo',
@@ -60,6 +61,7 @@ module.exports = ctx => {
60
61
  spotify: require('./spotify')(ctx),
61
62
  substack: require('./substack')(ctx),
62
63
  telegram: require('./telegram')(ctx),
64
+ threads: require('./threads')(ctx),
63
65
  tiktok: require('./tiktok')(ctx),
64
66
  twitch: require('./twitch')(ctx),
65
67
  vimeo: require('./vimeo')(ctx),
@@ -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