mkmrare/fetch.ts
2019-11-21 16:56:34 +01:00

16 lines
394 B
TypeScript

import CardMarketApi from "./api";
import { asyncSaveJSON } from "./utils";
async function run() {
if (process.argv.length < 3) {
console.error("Usage: yarn fetch <uid>");
process.exit(1);
return;
}
const uid = process.argv[2];
let api = new CardMarketApi();
const articles = await api.getAllArticles(uid);
await asyncSaveJSON(`${uid}-cards.json`, articles);
}
run();