‹ YS-129271

「ニュースで学ぶ現代英語」で使ってるやつ

Jan 22, 2023
// 全文を再生する
(async()=>{const a=i=>new Promise(a=>setTimeout(a,i));for await(audio of document.querySelectorAll(".audio-play")){audio.click();while(audio.classList.contains("playing")){await a(100)}}})()
// source
const play_all = async () => {
	const sleep = (milsec) => new Promise(resolve => setTimeout(resolve, milsec))
	for await (audio of document.querySelectorAll(".audio-play")) {
		audio.click()
		while (audio.classList.contains("playing")) {
			await sleep(100)
		}
	}
}

// 全文を出力する
(()=>{t=[];for(sentence of document.querySelectorAll(".sentence")){t.push(sentence.childNodes[0].innerText)}console.log(t.join("\n"))})()
// source
const print_all = () => {
	t = []
	for (sentence of document.querySelectorAll(".sentence")) {
		t.push(sentence.childNodes[0].innerText)
	}
	console.log(t.join("\n"))
}