aboutsummaryrefslogtreecommitdiff
path: root/src/server/ApiManagers/UtilManager.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/ApiManagers/UtilManager.ts')
-rw-r--r--src/server/ApiManagers/UtilManager.ts38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/server/ApiManagers/UtilManager.ts b/src/server/ApiManagers/UtilManager.ts
index dbf274e93..e590a5b85 100644
--- a/src/server/ApiManagers/UtilManager.ts
+++ b/src/server/ApiManagers/UtilManager.ts
@@ -4,7 +4,7 @@ import { exec } from 'child_process';
import { command_line } from "../ActionUtilities";
import RouteSubscriber from "../RouteSubscriber";
import { red } from "colors";
-import { main } from "../../scraping/buxton/node_scraper";
+import executeImport from "../../scraping/buxton/final/BuxtonImporter";
export default class UtilManager extends ApiManager {
@@ -40,29 +40,29 @@ export default class UtilManager extends ApiManager {
}
});
- register({
- method: Method.GET,
- subscription: "/buxton",
- secureHandler: async ({ res }) => {
- const cwd = './src/scraping/buxton';
+ // register({
+ // method: Method.GET,
+ // subscription: "/buxton",
+ // secureHandler: async ({ res }) => {
+ // const cwd = './src/scraping/buxton';
- const onResolved = (stdout: string) => { console.log(stdout); res.redirect("/"); };
- const onRejected = (err: any) => { console.error(err.message); res.send(err); };
- const tryPython3 = (reason: any) => {
- console.log("Initial scraper failed for the following reason:");
- console.log(red(reason.Error));
- console.log("Falling back to python3...");
- return command_line('python3 scraper.py', cwd).then(onResolved, onRejected);
- };
+ // const onResolved = (stdout: string) => { console.log(stdout); res.redirect("/"); };
+ // const onRejected = (err: any) => { console.error(err.message); res.send(err); };
+ // const tryPython3 = (reason: any) => {
+ // console.log("Initial scraper failed for the following reason:");
+ // console.log(red(reason.Error));
+ // console.log("Falling back to python3...");
+ // return command_line('python3 scraper.py', cwd).then(onResolved, onRejected);
+ // };
- return command_line('python scraper.py', cwd).then(onResolved, tryPython3);
- },
- });
+ // return command_line('python scraper.py', cwd).then(onResolved, tryPython3);
+ // },
+ // });
register({
method: Method.GET,
- subscription: "/newBuxton",
- secureHandler: async ({ res }) => res.send(await main())
+ subscription: "/buxton",
+ secureHandler: async ({ res }) => res.send(await executeImport())
});
register({