From 5aa04d60b1602dbb6166c5459a2f1c1792e634c0 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Tue, 11 Nov 2025 16:45:33 -0800 Subject: move import script paths according to import method --- scripts/dancearound/README.md | 8 - .../dancearound/dancearound_play_history.user.js | 168 --------------------- scripts/dancearound/eamuse/README.md | 8 + .../eamuse/dancearound_play_history.user.js | 168 +++++++++++++++++++++ 4 files changed, 176 insertions(+), 176 deletions(-) delete mode 100644 scripts/dancearound/README.md delete mode 100644 scripts/dancearound/dancearound_play_history.user.js create mode 100644 scripts/dancearound/eamuse/README.md create mode 100644 scripts/dancearound/eamuse/dancearound_play_history.user.js (limited to 'scripts/dancearound') diff --git a/scripts/dancearound/README.md b/scripts/dancearound/README.md deleted file mode 100644 index 404f605..0000000 --- a/scripts/dancearound/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# DANCE aROUND - -Score Page: https://p.eagate.573.jp/game/around/1st/playdata/index.html#play_hist - -**Dance aROUND only stores a record of your last 30 plays**. Anything older than that will not have date data and can only be retrieved via looking at your best scores. - -*Scripts Available:* -- [Recently Played History](./dancearound_play_history.user.js) \ No newline at end of file diff --git a/scripts/dancearound/dancearound_play_history.user.js b/scripts/dancearound/dancearound_play_history.user.js deleted file mode 100644 index eccc1a9..0000000 --- a/scripts/dancearound/dancearound_play_history.user.js +++ /dev/null @@ -1,168 +0,0 @@ -// ==UserScript== -// @name DANCEAROUND (e-amusement) Recently Played Mirage Scraper -// @namespace http://tampermonkey.net/ -// @version 1.0 -// @description DANCEAROUND e-amusement site to Mirage import JSON -// @match https://p.eagate.573.jp/game/around/1st/playdata/index.html* -// @grant none -// @run-at document-idle -// ==/UserScript== - -(function () { - function waitFor(selector, timeout = 10000) { - return new Promise((resolve, reject) => { - const interval = 300; - let waited = 0; - const check = () => { - const el = document.querySelector(selector); - if (el) return resolve(el); - waited += interval; - if (waited >= timeout) return reject(`Timeout: ${selector}`); - setTimeout(check, interval); - }; - check(); - }); - } - - function getDifficulty(fumen, songData) { - let difficulty, lamp; - - switch (fumen) { - case "ADVANCED": - difficulty = songData?.ADVANCED?.level || 0; - lamp = "ADVANCED"; - break; - case "BASIC": - difficulty = songData?.BASIC?.level || 0; - lamp = "BASIC"; - break; - case "MASTER": - difficulty = songData?.MASTER?.level || 0; - lamp = "MASTER"; - break; - default: - difficulty = 0; - lamp = fumen; - break; - } - - return { difficulty, lamp }; - } - function getLampText(status) { - switch (status) { - case 0: - return "C"; - case 1: - return "B"; - case 2: - return "A"; - case 3: - return "AA"; - case 4: - return "AAA"; - case 5: - return "AAA+"; - } - } - - function getClearStatusText(status){ - switch(status){ - case 1: - return "FAILURE"; - case 2: - return "PASSED"; - case 3: - return "FULL COMBO"; - case 4: - return "EXC"; - } - } - - async function fetchAndDownload() { - const url = "https://p.eagate.573.jp/game/around/1st/json/pdata_getdata.html"; - const payload = new URLSearchParams({ - service_kind: "play_hist", - pdata_kind: "play_hist", - }); - - try { - const response = await fetch(url, { - method: "POST", - credentials: "include", - headers: { - "Content-Type": "application/x-www-form-urlencoded", - "X-Requested-With": "XMLHttpRequest", - }, - body: payload.toString(), - }); - - if (!response.ok) throw new Error(`HTTP ${response.status}`); - - const data = await response.json(); - const play_hist = data.data.easite_get_playerdata.music_hist.music; - const song_db = data.data.easite_get_playerdata.mdb; - let mirage = { - meta: { - game: "dancearound", - playtype: "Single", - service: "e-amusement PLAY HISTORY", - }, - }; - const remappedList = play_hist.map((entry) => { - const level = getDifficulty(entry.fumen_type, song_db[entry.music_id].fumens) - return { - title: song_db[entry.music_id].title_name, - artist: song_db[entry.music_id].artist_name, - level: level.difficulty, - score: entry.score, - lamp: getLampText(entry.rank), - clear_status: getClearStatusText(entry.clear_status), - difficulty: level.lamp, - timestamp: entry.play_date, - judgements: { - "perfect": entry.perfect, - "great": entry.great, - "good": entry.good, - "bad": entry.bad - }, - optional: { - maxCombo: entry.combo, - } - - }; - }); - mirage.scores = remappedList; - console.log("Final mirage object:", mirage); - - const blob = new Blob([JSON.stringify(mirage, null, 2)], { - type: "application/json", - }); - - const a = document.createElement("a"); - a.href = URL.createObjectURL(blob); - a.download = "dancearound_scores_mirage_import.json"; - a.click(); - console - } catch (err) { - console.error("Fetch/download error:", err); - alert("Failed to fetch or process JSON. See console for details."); - } - } - - waitFor("#id_ctpl_body") - .then((container) => { - const btn = document.createElement("button"); - btn.textContent = "📥 DOWNLOAD PLAY HISTORY SCORE JSON"; - btn.style.cssText = ` - margin: 10px; padding: 8px 12px; - font-size: 14px; cursor: pointer; - background: #2563eb; color: white; - border: none; border-radius: 6px; - z-index: 9999; - `; - btn.onclick = fetchAndDownload; - - container.prepend(btn); - }) - .catch((err) => console.warn("Could not inject button:", err)); -})(); diff --git a/scripts/dancearound/eamuse/README.md b/scripts/dancearound/eamuse/README.md new file mode 100644 index 0000000..404f605 --- /dev/null +++ b/scripts/dancearound/eamuse/README.md @@ -0,0 +1,8 @@ +# DANCE aROUND + +Score Page: https://p.eagate.573.jp/game/around/1st/playdata/index.html#play_hist + +**Dance aROUND only stores a record of your last 30 plays**. Anything older than that will not have date data and can only be retrieved via looking at your best scores. + +*Scripts Available:* +- [Recently Played History](./dancearound_play_history.user.js) \ No newline at end of file diff --git a/scripts/dancearound/eamuse/dancearound_play_history.user.js b/scripts/dancearound/eamuse/dancearound_play_history.user.js new file mode 100644 index 0000000..eccc1a9 --- /dev/null +++ b/scripts/dancearound/eamuse/dancearound_play_history.user.js @@ -0,0 +1,168 @@ +// ==UserScript== +// @name DANCEAROUND (e-amusement) Recently Played Mirage Scraper +// @namespace http://tampermonkey.net/ +// @version 1.0 +// @description DANCEAROUND e-amusement site to Mirage import JSON +// @match https://p.eagate.573.jp/game/around/1st/playdata/index.html* +// @grant none +// @run-at document-idle +// ==/UserScript== + +(function () { + function waitFor(selector, timeout = 10000) { + return new Promise((resolve, reject) => { + const interval = 300; + let waited = 0; + const check = () => { + const el = document.querySelector(selector); + if (el) return resolve(el); + waited += interval; + if (waited >= timeout) return reject(`Timeout: ${selector}`); + setTimeout(check, interval); + }; + check(); + }); + } + + function getDifficulty(fumen, songData) { + let difficulty, lamp; + + switch (fumen) { + case "ADVANCED": + difficulty = songData?.ADVANCED?.level || 0; + lamp = "ADVANCED"; + break; + case "BASIC": + difficulty = songData?.BASIC?.level || 0; + lamp = "BASIC"; + break; + case "MASTER": + difficulty = songData?.MASTER?.level || 0; + lamp = "MASTER"; + break; + default: + difficulty = 0; + lamp = fumen; + break; + } + + return { difficulty, lamp }; + } + function getLampText(status) { + switch (status) { + case 0: + return "C"; + case 1: + return "B"; + case 2: + return "A"; + case 3: + return "AA"; + case 4: + return "AAA"; + case 5: + return "AAA+"; + } + } + + function getClearStatusText(status){ + switch(status){ + case 1: + return "FAILURE"; + case 2: + return "PASSED"; + case 3: + return "FULL COMBO"; + case 4: + return "EXC"; + } + } + + async function fetchAndDownload() { + const url = "https://p.eagate.573.jp/game/around/1st/json/pdata_getdata.html"; + const payload = new URLSearchParams({ + service_kind: "play_hist", + pdata_kind: "play_hist", + }); + + try { + const response = await fetch(url, { + method: "POST", + credentials: "include", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + "X-Requested-With": "XMLHttpRequest", + }, + body: payload.toString(), + }); + + if (!response.ok) throw new Error(`HTTP ${response.status}`); + + const data = await response.json(); + const play_hist = data.data.easite_get_playerdata.music_hist.music; + const song_db = data.data.easite_get_playerdata.mdb; + let mirage = { + meta: { + game: "dancearound", + playtype: "Single", + service: "e-amusement PLAY HISTORY", + }, + }; + const remappedList = play_hist.map((entry) => { + const level = getDifficulty(entry.fumen_type, song_db[entry.music_id].fumens) + return { + title: song_db[entry.music_id].title_name, + artist: song_db[entry.music_id].artist_name, + level: level.difficulty, + score: entry.score, + lamp: getLampText(entry.rank), + clear_status: getClearStatusText(entry.clear_status), + difficulty: level.lamp, + timestamp: entry.play_date, + judgements: { + "perfect": entry.perfect, + "great": entry.great, + "good": entry.good, + "bad": entry.bad + }, + optional: { + maxCombo: entry.combo, + } + + }; + }); + mirage.scores = remappedList; + console.log("Final mirage object:", mirage); + + const blob = new Blob([JSON.stringify(mirage, null, 2)], { + type: "application/json", + }); + + const a = document.createElement("a"); + a.href = URL.createObjectURL(blob); + a.download = "dancearound_scores_mirage_import.json"; + a.click(); + console + } catch (err) { + console.error("Fetch/download error:", err); + alert("Failed to fetch or process JSON. See console for details."); + } + } + + waitFor("#id_ctpl_body") + .then((container) => { + const btn = document.createElement("button"); + btn.textContent = "📥 DOWNLOAD PLAY HISTORY SCORE JSON"; + btn.style.cssText = ` + margin: 10px; padding: 8px 12px; + font-size: 14px; cursor: pointer; + background: #2563eb; color: white; + border: none; border-radius: 6px; + z-index: 9999; + `; + btn.onclick = fetchAndDownload; + + container.prepend(btn); + }) + .catch((err) => console.warn("Could not inject button:", err)); +})(); -- cgit v1.2.3