Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AdamSteffanick/c134c6631d33a52dbe9d9efa8fe6274a to your computer and use it in GitHub Desktop.
Save AdamSteffanick/c134c6631d33a52dbe9d9efa8fe6274a to your computer and use it in GitHub Desktop.
Full Text IA
for $doc in fn:collection("books")//book[@full-text eq "true"]
where fn:not($doc//subjects/subject = "Protected DAISY") (: existential quantification! :)
for $key in $doc/key/text()
let $data := fetch:text("https://openlibrary.org" || $key || ".json") => json:parse()
let $ocaid := $data//ocaid/text()
for $book in $ocaid
return fetch:text("https://archive.org/5/items/" || $book || "/" || $book || "_djvu.txt")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment