aboutsummaryrefslogtreecommitdiff
path: root/src/server/ApiManagers/UtilManager.ts
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2020-02-08 17:32:33 -0500
committerSam Wilkins <samwilkins333@gmail.com>2020-02-08 17:32:33 -0500
commit79e1323acd0d0f95d08a09cefce908e35d0e7558 (patch)
tree3ee8c780fca7d8a7a35847af5f59d2d3fd0875f6 /src/server/ApiManagers/UtilManager.ts
parent36933b7b647a54aa7bda0600612d34b402d42919 (diff)
initial commit, pending png read error bug fix
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({