flowerpicker 0.2.0 → 0.3.1
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 +11 -11
- package/index.js +30 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -45,17 +45,17 @@ The following account information is accessible via this package:
|
|
|
45
45
|
|
|
46
46
|
The following games may not be updated by me, PRs may be reviewed and accepted
|
|
47
47
|
|
|
48
|
-
| Game | Profile Information[^1] | Score Log | Game Specific Data |
|
|
49
|
-
| :------------------------------ | :---------------------: | :-------: | :----------------: |
|
|
50
|
-
| beatmania IIDX | ❌ | ❌ | ❌ |
|
|
51
|
-
| DanceDanceRevolution | ❌ | ❌ | ❌ |
|
|
52
|
-
| GITADORA | ❌ | ❌ | ❌ |
|
|
53
|
-
| Jubeat | ⚠️[^2] | ✅ | ❌[^3] |
|
|
54
|
-
| NOSTALGIA | ❌ | ❌ | ❌ |
|
|
55
|
-
| pop'n music | ❌ | ❌ | ❌ |
|
|
56
|
-
| REFLEC BEAT | ❌ | ❌ | ❌ |
|
|
57
|
-
| Sound Voltex | ❌ | ❌ | ❌ |
|
|
58
|
-
| PASELI Charging Machine (Soon™️) | ❌ | ❌ | ❌ |
|
|
48
|
+
| Game | Profile Information[^1] | Score Log | Game Specific Data | Tachi Export |
|
|
49
|
+
| :------------------------------ | :---------------------: | :-------: | :----------------: | :----------: |
|
|
50
|
+
| beatmania IIDX | ❌ | ❌ | ❌ | ❌ |
|
|
51
|
+
| DanceDanceRevolution | ❌ | ❌ | ❌ | ❌ |
|
|
52
|
+
| GITADORA | ❌ | ❌ | ❌ | ❌ |
|
|
53
|
+
| Jubeat | ⚠️[^2] | ✅ | ❌[^3] | ✅ |
|
|
54
|
+
| NOSTALGIA | ❌ | ❌ | ❌ | ❌ |
|
|
55
|
+
| pop'n music | ❌ | ❌ | ❌ | ❌ |
|
|
56
|
+
| REFLEC BEAT | ❌ | ❌ | ❌ | ❌ |
|
|
57
|
+
| Sound Voltex | ❌ | ❌ | ❌ | ❌ |
|
|
58
|
+
| PASELI Charging Machine (Soon™️) | ❌ | ❌ | ❌ | ❌ |
|
|
59
59
|
|
|
60
60
|
[^1]: Profile information includes profile id(s) on the site, game display name, and unlock statuses
|
|
61
61
|
|
package/index.js
CHANGED
|
@@ -113,6 +113,35 @@ class FlowerPicker {
|
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
async getProfileId(game, id) {
|
|
117
|
+
const res = await this._fetchWithCookie(`${this._baseURL}/game/${game}${this._doesGameHaveProfileInUrl(game) ? '/profile' : ''}/${id}`);
|
|
118
|
+
const html = await res.text();
|
|
119
|
+
const $ = cheerio.load(html);
|
|
120
|
+
|
|
121
|
+
const href = $("small > a").first().attr("href");
|
|
122
|
+
if (!href) return null;
|
|
123
|
+
|
|
124
|
+
return href.split("/")[4] ?? null;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
_doesGameHaveProfileInUrl(game) {
|
|
128
|
+
switch (game) {
|
|
129
|
+
case 'iidx':
|
|
130
|
+
case 'jubeat':
|
|
131
|
+
case 'rb':
|
|
132
|
+
case 'gitadora':
|
|
133
|
+
case 'sdvx':
|
|
134
|
+
case 'museca':
|
|
135
|
+
return true;
|
|
136
|
+
case 'ddr':
|
|
137
|
+
case 'nostalgia':
|
|
138
|
+
case 'pnm':
|
|
139
|
+
return false;
|
|
140
|
+
default:
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
116
145
|
async _fetchWithCookie(url) {
|
|
117
146
|
return fetch(url, {
|
|
118
147
|
headers: {
|
|
@@ -201,7 +230,7 @@ class FlowerPicker {
|
|
|
201
230
|
let walletID = theElement.attr('href')?.split('/').pop();
|
|
202
231
|
let walletBalance = this._trimToNumber(theElement.children('.list-group-item-text').text());
|
|
203
232
|
|
|
204
|
-
walletIDs.push({arcadeName, walletID, walletBalance});
|
|
233
|
+
walletIDs.push({ arcadeName, walletID, walletBalance });
|
|
205
234
|
});
|
|
206
235
|
|
|
207
236
|
return walletIDs;
|