Align header, footer, brand, homepage course preview, faculty links, and the course catalog with the documented changes. Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
973 B
JavaScript
25 lines
973 B
JavaScript
import fs from "node:fs";
|
|
|
|
const html = fs.readFileSync("tmp-faculty.html", "utf8");
|
|
const cardRe = /<div class="mstf-card[^"]*"[\s\S]*?<\/div>\s*<\/div>/g;
|
|
const cards = html.match(cardRe) ?? [];
|
|
console.log("cards", cards.length);
|
|
for (const c of cards.slice(0, 3)) {
|
|
const name = c.match(/mstf-name">([^<]+)/)?.[1];
|
|
const pill = c.match(/mstf-pill">([^<]+)/)?.[1];
|
|
const dept = c
|
|
.match(/mstf-dept">([\s\S]*?)<\/div>/)?.[1]
|
|
?.replace(/<[^>]+>/g, "")
|
|
.replace(/\s+/g, " ")
|
|
.trim();
|
|
const focus = c
|
|
.match(/mstf-int"><b>[^<]*<\/b>\s*([^<]+)/)?.[1]
|
|
?.trim();
|
|
const email = c.match(/mailto:([^"'\s]+)/)?.[1];
|
|
const phone = c.match(/tel:(\+?\d+)/)?.[1];
|
|
const linkedin = c.match(/mstf-i-linkedin" href="([^"]+)"/)?.[1];
|
|
const scholar = c.match(/mstf-i-scholar" href="([^"]+)"/)?.[1];
|
|
const img = c.match(/mstf-avatar"><img[^>]+src="([^"]+)"/)?.[1];
|
|
console.log({ name, pill, dept, focus, email, phone, linkedin, scholar, img });
|
|
}
|