@unavatar/core 3.39.0 → 3.40.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
@@ -70,6 +70,7 @@
70
70
  - [Twitch](#twitch)
71
71
  - [Vimeo](#vimeo)
72
72
  - [WhatsApp](#whatsapp)
73
+ - [Wise](#wise)
73
74
  - [X/Twitter](#xtwitter)
74
75
  - [Xbox Gamertag](#xbox-gamertag)
75
76
  - [YouTube](#youtube)
@@ -962,6 +963,12 @@ Available inputs:
962
963
  - `channel`: [unavatar.io/whatsapp/channel:0029VaARuQ7KwqSXh9fiMc0m](https://unavatar.io/whatsapp/channel:0029VaARuQ7KwqSXh9fiMc0m)
963
964
  - `chat`: [unavatar.io/whatsapp/chat:D2FFycjQXrEIKG8qQjbwZz](https://unavatar.io/whatsapp/chat:D2FFycjQXrEIKG8qQjbwZz)
964
965
 
966
+ ### Wise
967
+
968
+ Get any Wise user's profile picture by their Wisetag.
969
+
970
+ e.g., [unavatar.io/wise/josev2264](https://unavatar.io/wise/josev2264)
971
+
965
972
  ### X/Twitter
966
973
 
967
974
  Get any X (formerly Twitter) user'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.39.0",
5
+ "version": "3.40.0",
6
6
  "main": "src/index.js",
7
7
  "exports": {
8
8
  ".": "./src/index.js",
@@ -54,6 +54,7 @@ const providersBy = {
54
54
  'tumblr',
55
55
  'twitch',
56
56
  'vimeo',
57
+ 'wise',
57
58
  'x',
58
59
  'xboxgamertag',
59
60
  'youtube'
@@ -119,6 +120,7 @@ module.exports = ctx => {
119
120
  twitch: require('./twitch')(ctx),
120
121
  vimeo: require('./vimeo')(ctx),
121
122
  whatsapp: require('./whatsapp')(ctx),
123
+ wise: require('./wise')(ctx),
122
124
  x: require('./x')(ctx),
123
125
  xboxgamertag: require('./xboxgamertag')(ctx),
124
126
  youtube: require('./youtube')(ctx)
@@ -0,0 +1,30 @@
1
+ 'use strict'
2
+
3
+ const { get } = require('lodash')
4
+
5
+ const getAvatarUrl = input => `https://wise.com/pay/me/${input}`
6
+
7
+ const getAvatar = $ => {
8
+ const text = $('#__NEXT_DATA__').contents().text()
9
+ if (!text) return
10
+ return get(JSON.parse(text), [
11
+ 'props',
12
+ 'pageProps',
13
+ 'match',
14
+ 'display',
15
+ 'avatar',
16
+ 'value'
17
+ ])
18
+ }
19
+
20
+ const factory = ({ createHtmlProvider }) =>
21
+ createHtmlProvider({
22
+ name: 'wise',
23
+ url: getAvatarUrl,
24
+ getter: getAvatar
25
+ })
26
+
27
+ factory.getAvatarUrl = getAvatarUrl
28
+ factory.getAvatar = getAvatar
29
+
30
+ module.exports = factory