aboutsummaryrefslogtreecommitdiff
path: root/src/scraping/buxton/node_scraper.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/scraping/buxton/node_scraper.ts')
-rw-r--r--src/scraping/buxton/node_scraper.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/scraping/buxton/node_scraper.ts b/src/scraping/buxton/node_scraper.ts
index 1111b9b4b..f80821ea5 100644
--- a/src/scraping/buxton/node_scraper.ts
+++ b/src/scraping/buxton/node_scraper.ts
@@ -1,6 +1,6 @@
import { readdirSync, writeFile } from "fs";
import * as path from "path";
-import { red, green, cyan, yellow } from "colors";
+import { red, cyan, yellow } from "colors";
const StreamZip = require('node-stream-zip');
export interface DeviceDocument {
@@ -157,6 +157,7 @@ async function parse() {
const sourceDirectory = path.resolve(`${__dirname}/source`);
const candidates = readdirSync(sourceDirectory).filter(file => file.endsWith(".doc") || file.endsWith(".docx")).map(file => `${sourceDirectory}/${file}`);
const imported = await Promise.all(candidates.map(async path => ({ path, body: await extract(path) })));
+ // const imported = [{ path: candidates[10], body: await extract(candidates[10]) }];
const data = imported.map(({ path, body }) => analyze(path, body));
const masterdevices: DeviceDocument[] = [];
const masterErrors: any[] = [];
@@ -168,9 +169,9 @@ async function parse() {
}
});
const total = candidates.length;
- if (masterdevices.length + masterErrors.length !== total) {
- throw new Error(`Encountered a ${masterdevices.length} to ${masterErrors.length} mismatch in device / error split!`);
- }
+ // if (masterdevices.length + masterErrors.length !== total) {
+ // throw new Error(`Encountered a ${masterdevices.length} to ${masterErrors.length} mismatch in device / error split!`);
+ // }
console.log();
await writeOutputFile("buxton.json", masterdevices, total, true);
await writeOutputFile("errors.json", masterErrors, total, false);