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";
import { CNFetcher } from "./src/fetcher";
import _ from "underscore";
async function main() {
async function fetchCardsFromNW(dbreader: DBReader) {
const fetcher = new CNFetcher({ name: "Fetcher", level: "debug" });
await fetcher.init();
const strings = await fetcher.fetch();
return await dbreader.getAllCardsFromJapaneseNames(strings);
}
async function main() {
const dbreader = new DBReader({ name: "Database", level: "debug" });
await dbreader.init();
const strings = await fetcher.fetch();
const cards = await dbreader.getAllCardsFromJapaneseNames(strings);
const cards = await fetchCardsFromNW(dbreader);
await dbreader.run(cards);
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