Commit bcfeac62 authored by nanahira's avatar nanahira

little work for adapting other datasources

parent dd1a09cb
Pipeline #935 passed with stages
in 1 minute and 39 seconds
...@@ -2,13 +2,17 @@ import { DBReader } from "./src/dbreader"; ...@@ -2,13 +2,17 @@ import { DBReader } from "./src/dbreader";
import { CNFetcher } from "./src/fetcher"; import { CNFetcher } from "./src/fetcher";
import _ from "underscore"; import _ from "underscore";
async function main() { async function fetchCardsFromNW(dbreader: DBReader) {
const fetcher = new CNFetcher({ name: "Fetcher", level: "debug" }); const fetcher = new CNFetcher({ name: "Fetcher", level: "debug" });
await fetcher.init(); await fetcher.init();
const strings = await fetcher.fetch();
return await dbreader.getAllCardsFromJapaneseNames(strings);
}
async function main() {
const dbreader = new DBReader({ name: "Database", level: "debug" }); const dbreader = new DBReader({ name: "Database", level: "debug" });
await dbreader.init(); await dbreader.init();
const strings = await fetcher.fetch(); const cards = await fetchCardsFromNW(dbreader);
const cards = await dbreader.getAllCardsFromJapaneseNames(strings);
await dbreader.run(cards); await dbreader.run(cards);
process.exit(); process.exit();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment