Created
August 11, 2023 19:07
-
-
Save yaasita/b681cea42c25931be58812567c4df209 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env node | |
import fs from "fs"; | |
import { JSDOM } from "jsdom"; | |
const content = fs.readFileSync("tmp/index.html", "utf8"); | |
const dom = new JSDOM(content); | |
const todayEvents = dom.window.document.querySelector( | |
"#calendarAria .calendarDateBox", | |
); | |
for (const e of todayEvents.querySelectorAll("dl")) { | |
const country = e.querySelector("img").alt; | |
if (country !== "アメリカ") { | |
continue; | |
} | |
const star = e.querySelector(".importance img").src; | |
if (!star.match(/star_quintuple/)) { | |
continue; | |
} | |
const time = e.querySelector(".time").textContent; | |
const name = e.querySelector(".name").textContent; | |
console.log(`${time.padStart(5)} ${name}`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment