From caa18e81e8eb03fb03a82d0d3526994c9ba41ac2 Mon Sep 17 00:00:00 2001 From: Yuren Hao <97327730+YurenHao0426@users.noreply.github.com> Date: Wed, 6 Aug 2025 02:00:55 -0700 Subject: fix: force IPv4 for scraper --- .github/workflows/update-and-deploy.yml | 2 ++ package.json | 3 ++- scripts/scrape.js | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-and-deploy.yml b/.github/workflows/update-and-deploy.yml index 0e29cad..fb034a6 100644 --- a/.github/workflows/update-and-deploy.yml +++ b/.github/workflows/update-and-deploy.yml @@ -16,6 +16,8 @@ jobs: node-version: 18 - run: npm ci - name: Scrape UIUC catalog + env: + NODE_OPTIONS: --dns-result-order=ipv4first run: npm run scrape - name: Commit data run: | diff --git a/package.json b/package.json index 1b03247..4844bba 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "dev": "vite", "build": "tsc --noEmit && vite build", "preview": "vite preview", - "scrape": "node scripts/scrape.js 2025 fall" + "scrape": "node scripts/scrape.js 2025 fall", + "test": "echo \"(no tests yet)\"" }, "dependencies": { "cytoscape": "^3.28.0", diff --git a/scripts/scrape.js b/scripts/scrape.js index 0de8bb3..2bfca5e 100644 --- a/scripts/scrape.js +++ b/scripts/scrape.js @@ -1,6 +1,9 @@ import { XMLParser } from "fast-xml-parser"; import fs from "fs/promises"; import path from "path"; +import dns from "node:dns"; + +dns.setDefaultResultOrder("ipv4first"); const [ , , YEAR = "2025", TERM = "fall" ] = process.argv; const parser = new XMLParser({ ignoreAttributes: false }); -- cgit v1.2.3