Browse Source

add querying script (for fun)

main
parent
commit
130421afb7
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      scripts/query-anki.ts

+ 12
- 0
scripts/query-anki.ts View File

@ -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)));
});

Loading…
Cancel
Save