@unavatar/core 3.37.1 → 3.39.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
@@ -49,11 +49,13 @@
49
49
  - [OnlyFans](#onlyfans)
50
50
  - [OpenStreetMap](#openstreetmap)
51
51
  - [Patreon](#patreon)
52
+ - [PayPal](#paypal)
52
53
  - [Pinterest](#pinterest)
53
54
  - [Printables](#printables)
54
55
  - [Product Hunt](#product-hunt)
55
56
  - [PSN Profiles](#psn-profiles)
56
57
  - [Reddit](#reddit)
58
+ - [Revolut](#revolut)
57
59
  - [Snapchat](#snapchat)
58
60
  - [SoundCloud](#soundcloud)
59
61
  - [Spotify](#spotify)
@@ -796,6 +798,12 @@ Get any Patreon creator's profile picture by their username.
796
798
 
797
799
  e.g., [unavatar.io/patreon/gametestro](https://unavatar.io/patreon/gametestro)
798
800
 
801
+ ### PayPal
802
+
803
+ Get any PayPal user's profile picture by their PayPal.Me username.
804
+
805
+ e.g., [unavatar.io/paypal/kikobeats](https://unavatar.io/paypal/kikobeats)
806
+
799
807
  ### Pinterest
800
808
 
801
809
  Get any Pinterest user's profile picture by their username.
@@ -836,6 +844,12 @@ Available inputs:
836
844
  - Username, e.g., [unavatar.io/reddit/thisisbillgates](https://unavatar.io/reddit/thisisbillgates)
837
845
  - Organization, e.g., [unavatar.io/reddit/nasa](https://unavatar.io/reddit/nasa)
838
846
 
847
+ ### Revolut
848
+
849
+ Get any Revolut user's profile picture by their Revolut.Me username.
850
+
851
+ e.g., [unavatar.io/revolut/midudev](https://unavatar.io/revolut/midudev)
852
+
839
853
  ### Snapchat
840
854
 
841
855
  Get any Snapchat 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.37.1",
5
+ "version": "3.39.0",
6
6
  "main": "src/index.js",
7
7
  "exports": {
8
8
  ".": "./src/index.js",
@@ -31,6 +31,7 @@ const providersBy = {
31
31
  'onlyfans',
32
32
  'openstreetmap',
33
33
  'patreon',
34
+ 'paypal',
34
35
  'pinterest',
35
36
  'printables',
36
37
  'primal',
@@ -38,6 +39,7 @@ const providersBy = {
38
39
  'psnprofiles',
39
40
  'raycast',
40
41
  'reddit',
42
+ 'revolut',
41
43
  'snapchat',
42
44
  'soundcloud',
43
45
  'spotify',
@@ -93,6 +95,7 @@ module.exports = ctx => {
93
95
  onlyfans: require('./onlyfans')(ctx),
94
96
  openstreetmap: require('./openstreetmap')(ctx),
95
97
  patreon: require('./patreon')(ctx),
98
+ paypal: require('./paypal')(ctx),
96
99
  pinterest: require('./pinterest')(ctx),
97
100
  printables: require('./printables')(ctx),
98
101
  primal: require('./primal')(ctx),
@@ -100,6 +103,7 @@ module.exports = ctx => {
100
103
  psnprofiles: require('./psnprofiles')(ctx),
101
104
  raycast: require('./raycast')(ctx),
102
105
  reddit: require('./reddit')(ctx),
106
+ revolut: require('./revolut')(ctx),
103
107
  snapchat: require('./snapchat')(ctx),
104
108
  soundcloud: require('./soundcloud')(ctx),
105
109
  spotify: require('./spotify')(ctx),
@@ -0,0 +1,28 @@
1
+ 'use strict'
2
+
3
+ const { get } = require('lodash')
4
+
5
+ const getAvatarUrl = input => `https://www.paypal.com/paypalme/${input}`
6
+
7
+ const getAvatar = $ => {
8
+ const text = $('#client-data').contents().text()
9
+ if (!text) return
10
+ return get(JSON.parse(text), [
11
+ 'recipientSlugDetails',
12
+ 'slugDetails',
13
+ 'userInfo',
14
+ 'profilePhotoUrl'
15
+ ])
16
+ }
17
+
18
+ const factory = ({ createHtmlProvider }) =>
19
+ createHtmlProvider({
20
+ name: 'paypal',
21
+ url: getAvatarUrl,
22
+ getter: getAvatar
23
+ })
24
+
25
+ factory.getAvatarUrl = getAvatarUrl
26
+ factory.getAvatar = getAvatar
27
+
28
+ module.exports = factory
@@ -0,0 +1,11 @@
1
+ 'use strict'
2
+
3
+ const getAvatarUrl = input =>
4
+ `https://revolut.me/api/web-profile/${input}/picture`
5
+
6
+ module.exports = () =>
7
+ function revolut (input) {
8
+ return getAvatarUrl(input)
9
+ }
10
+
11
+ module.exports.getAvatarUrl = getAvatarUrl