import { scrapeCLASS } from "./scrape.ts"; import { convert } from "./convert.ts"; import { stringify } from "./stringify.ts"; try { const title = window.prompt("授業情報ページの頭文字"); if (title) { const pages = stringify(title, convert(scrapeCLASS(), new Date(2024, 3, 11))); const blob = new Blob([JSON.stringify({ pages })], { type: "application/json" }); window.open(URL.createObjectURL(blob)); } } catch(e) { if (!(e instanceof Error)) { alert(JSON.stringify(e)); throw e; } alert(`${e.name} ${e.message}\n\n${e.stack}`); }