From 130421afb759cadf154a83be285548f47a365e20 Mon Sep 17 00:00:00 2001 From: Pacharapol Withayasakpunt Date: Wed, 27 Apr 2022 15:54:29 +0700 Subject: [PATCH] add querying script (for fun) --- scripts/query-anki.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 scripts/query-anki.ts diff --git a/scripts/query-anki.ts b/scripts/query-anki.ts new file mode 100644 index 0000000..0858c0c --- /dev/null +++ b/scripts/query-anki.ts @@ -0,0 +1,12 @@ +import { AnkiConnect } from '@/ankiconnect'; + +const anki = new AnkiConnect(); +anki + .api('findNotes', { + query: + 'deck:Takoboto -Takoboto: tag:common -tag:reading-challenge -tag:favorites -tag:death-note -tag:ハピネス -tag:https://www.bunka.go.jp/seisaku/bunkashingikai/kokugo/hokoku/pdf/ijidokun_140221.pdf', + }) + .then((notes) => anki.api('notesInfo', { notes })) + .then((notes) => { + console.log(new Set(notes.flatMap((n) => n.tags))); + });