Created
January 11, 2022 12:32
-
-
Save aikatsukamen/a6a61b530c5ac26b930cb30205c545a6 to your computer and use it in GitHub Desktop.
プラネットのカレンダー (2021/03~)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var list = []; | |
| document.querySelectorAll(".monthCol").forEach((value, index) => { | |
| //console.log(value); | |
| const month = value.querySelector(".monthCol_title").innerText; | |
| //console.log(month); | |
| value.querySelectorAll(".dayCol").forEach((value2, index2) => { | |
| //console.log(value2); | |
| const day = value2.querySelector(".dayCol_num").innerHTML.replace(/<span>/, "(").replace(/<\/span>/, ")"); | |
| const dateStr = month + day; | |
| //console.log(dateStr); | |
| let dateExist = false; | |
| value2.querySelectorAll(".dayCol_list").forEach((value3, index3) => { | |
| let href = value3.getAttribute("href"); | |
| if(href && !href.includes("http")) href = "https://www.aikatsu.com" + href; | |
| const text = value3.querySelector(".dayCol_txt").innerText; | |
| const className = value3.getAttribute("class").replace("dayCol_list ", ""); | |
| let classText = ""; | |
| switch(className) { | |
| case "ctgGoods": | |
| classText = "グッズ"; | |
| break; | |
| case "ctgEvent": | |
| classText = "イベント"; | |
| break; | |
| case "ctgAnime": | |
| classText = "アニメ"; | |
| break; | |
| case "ctgTVprogram": | |
| classText = "テレビ"; | |
| break; | |
| case "ctgTV": | |
| classText = "テレビ"; | |
| break; | |
| case "ctgDelivery": | |
| classText = "配信"; | |
| break; | |
| case "ctgGame": | |
| classText = "ゲーム"; | |
| break; | |
| case "ctgWeb": | |
| classText = "WEB"; | |
| break; | |
| case "ctgMovie": | |
| classText = "ムービー"; | |
| break; | |
| case "ctgAnniversary": | |
| classText = "記念日"; | |
| break; | |
| case "ctgBirthday": | |
| classText = "誕生日"; | |
| break; | |
| case "ctgOther": | |
| classText = "その他"; | |
| break; | |
| } | |
| console.log(`${dateStr} ${classText} ${text} ${href}`); | |
| let resultStr = ""; | |
| if(!dateExist) { | |
| resultStr = `| ${dateStr} |`; | |
| } else { | |
| resultStr = "|^ |"; | |
| } | |
| if(href) { | |
| resultStr += ` ${classText} | [[${text}>${href}]] |`; | |
| } else { | |
| resultStr += ` ${classText} | ${text} |`; | |
| } | |
| dateExist=true; | |
| list.push(resultStr) | |
| }); | |
| }); | |
| }); | |
| console.log(list.join("\n")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment