flowerpicker 0.2.0 → 0.3.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.
Files changed (3) hide show
  1. package/README.md +11 -11
  2. package/index.js +12 -1
  3. 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,17 @@ class FlowerPicker {
113
113
  });
114
114
  }
115
115
 
116
+ async getProfileId(game, id) {
117
+ const res = await this._fetchWithCookie(`${this._baseURL}/game/${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
+
116
127
  async _fetchWithCookie(url) {
117
128
  return fetch(url, {
118
129
  headers: {
@@ -201,7 +212,7 @@ class FlowerPicker {
201
212
  let walletID = theElement.attr('href')?.split('/').pop();
202
213
  let walletBalance = this._trimToNumber(theElement.children('.list-group-item-text').text());
203
214
 
204
- walletIDs.push({arcadeName, walletID, walletBalance});
215
+ walletIDs.push({ arcadeName, walletID, walletBalance });
205
216
  });
206
217
 
207
218
  return walletIDs;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowerpicker",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Data scraper for a certain rhythm game website",
5
5
  "author": "BoopDog",
6
6
  "license": "MIT",