@unavatar/core 3.39.0 → 3.41.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
@@ -68,8 +68,10 @@
68
68
  - [TikTok](#tiktok)
69
69
  - [Tumblr](#tumblr)
70
70
  - [Twitch](#twitch)
71
+ - [Venmo](#venmo)
71
72
  - [Vimeo](#vimeo)
72
73
  - [WhatsApp](#whatsapp)
74
+ - [Wise](#wise)
73
75
  - [X/Twitter](#xtwitter)
74
76
  - [Xbox Gamertag](#xbox-gamertag)
75
77
  - [YouTube](#youtube)
@@ -942,6 +944,12 @@ Get any Twitch streamer's profile picture by their username.
942
944
 
943
945
  e.g., [unavatar.io/twitch/midudev](https://unavatar.io/twitch/midudev)
944
946
 
947
+ ### Venmo
948
+
949
+ Get any Venmo user's profile picture by their username.
950
+
951
+ e.g., [unavatar.io/venmo/Jessica-Lee-77](https://unavatar.io/venmo/Jessica-Lee-77)
952
+
945
953
  ### Vimeo
946
954
 
947
955
  Get any Vimeo user's profile picture by their username.
@@ -962,6 +970,12 @@ Available inputs:
962
970
  - `channel`: [unavatar.io/whatsapp/channel:0029VaARuQ7KwqSXh9fiMc0m](https://unavatar.io/whatsapp/channel:0029VaARuQ7KwqSXh9fiMc0m)
963
971
  - `chat`: [unavatar.io/whatsapp/chat:D2FFycjQXrEIKG8qQjbwZz](https://unavatar.io/whatsapp/chat:D2FFycjQXrEIKG8qQjbwZz)
964
972
 
973
+ ### Wise
974
+
975
+ Get any Wise user's profile picture by their Wisetag.
976
+
977
+ e.g., [unavatar.io/wise/josev2264](https://unavatar.io/wise/josev2264)
978
+
965
979
  ### X/Twitter
966
980
 
967
981
  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.41.0",
6
6
  "main": "src/index.js",
7
7
  "exports": {
8
8
  ".": "./src/index.js",
@@ -53,7 +53,9 @@ const providersBy = {
53
53
  'tiktok',
54
54
  'tumblr',
55
55
  'twitch',
56
+ 'venmo',
56
57
  'vimeo',
58
+ 'wise',
57
59
  'x',
58
60
  'xboxgamertag',
59
61
  'youtube'
@@ -117,8 +119,10 @@ module.exports = ctx => {
117
119
  tiktok: require('./tiktok')(ctx),
118
120
  tumblr: require('./tumblr')(ctx),
119
121
  twitch: require('./twitch')(ctx),
122
+ venmo: require('./venmo')(ctx),
120
123
  vimeo: require('./vimeo')(ctx),
121
124
  whatsapp: require('./whatsapp')(ctx),
125
+ wise: require('./wise')(ctx),
122
126
  x: require('./x')(ctx),
123
127
  xboxgamertag: require('./xboxgamertag')(ctx),
124
128
  youtube: require('./youtube')(ctx)
@@ -0,0 +1,28 @@
1
+ 'use strict'
2
+
3
+ const { get } = require('lodash')
4
+
5
+ const getAvatarUrl = input => `https://account.venmo.com/u/${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
+ 'user',
14
+ 'profilePictureUrl'
15
+ ])
16
+ }
17
+
18
+ const factory = ({ createHtmlProvider }) =>
19
+ createHtmlProvider({
20
+ name: 'venmo',
21
+ url: getAvatarUrl,
22
+ getter: getAvatar
23
+ })
24
+
25
+ factory.getAvatarUrl = getAvatarUrl
26
+ factory.getAvatar = getAvatar
27
+
28
+ module.exports = factory
@@ -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