diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-10-12 16:41:30 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-10-12 16:41:30 -0700 |
| commit | 08554e29c4e8b09469bf5534137b4281dba9221e (patch) | |
| tree | 3b50ec95b2166f1a130c0236a6534221c7b15866 /scripts/reflecbeat/reflecbeat_flower_scraper.js | |
| parent | 43a43fd0d8b251fe29a09b59010cd16ef2567e0d (diff) | |
add reflec beat score display view
Diffstat (limited to 'scripts/reflecbeat/reflecbeat_flower_scraper.js')
| -rw-r--r-- | scripts/reflecbeat/reflecbeat_flower_scraper.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/reflecbeat/reflecbeat_flower_scraper.js b/scripts/reflecbeat/reflecbeat_flower_scraper.js index 42050d6..1152da9 100644 --- a/scripts/reflecbeat/reflecbeat_flower_scraper.js +++ b/scripts/reflecbeat/reflecbeat_flower_scraper.js @@ -1,6 +1,6 @@ // ==UserScript== // @name REFLEC BEAT SCORE EXPORT -// @namespace https://example.com/ +// @namespace http://tampermonkey.net/ // @version 1.2 // @description Export REFLEC BEAT scores including full judgements and timestamps as JSON // @match https://projectflower.eu/game/rb/profile/* @@ -56,8 +56,9 @@ const levelElem = difficultyElem?.querySelector('strong'); const lampElem = row.querySelector('td.rb-rank strong'); // Rank / Lamp const scoreText = row.querySelector('td.rb-rank span')?.innerText || ''; - const scoreMatch = scoreText.replace(/,/g, '').match(/\d+/); - const scoreNum = scoreMatch ? parseInt(scoreMatch[0]) : null; + const scoreMatch = scoreText.match(/(\d+(?:,\d+)*)\s*\((\d+(?:\.\d+)?)%\)/); + const scoreNum = scoreMatch ? parseInt(scoreMatch[1].replace(/,/g, '')) : null; + const scorePercent = scoreMatch ? parseFloat(scoreMatch[2]) : null; // Extract timestamp from <small> in last column const timestampElem = row.querySelector('td.hidden-from-mobile small'); @@ -96,6 +97,7 @@ difficulty: difficultyElem?.innerText.replace(levelElem?.innerText, '').trim() || '', level: levelElem ? parseInt(levelElem.innerText.trim()) : null, score: scoreNum, + scorePercent, lamp: lampElem?.innerText.trim() || '', lifeLeft: parseInt(lifeLeft) || null, timestamp, // Unix ms |
