Created
July 27, 2022 03:36
-
-
Save uribo/be8c0e49a946d5f50b2555303e9f6a59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apple_book_name_fix <- function(data) { | |
purrr::set_names(data, | |
stringr::str_to_lower( | |
stringr::str_remove(names(data), "^Z") | |
)) | |
} | |
apple_book_markers <- function() { | |
con <- DBI::dbConnect(RSQLite::SQLite(), | |
"~/Library/Containers/com.apple.iBooksX/Data/Documents/AEAnnotation/AEAnnotation_v10312011_1727_local.sqlite", | |
synchronous = NULL) | |
df <- | |
tibble::as_tibble(dbReadTable(con, 'ZAEANNOTATION')) |> | |
apple_book_name_fix() |> | |
dplyr::filter(!is.na(annotationselectedtext)) |> | |
dplyr::select(annotationstyle, annotationtype, annotationassetid, annotationselectedtext, futureproofing5) | |
DBI::dbDisconnect(con) | |
df | |
} | |
apple_book_list <- function() { | |
con <- DBI::dbConnect(RSQLite::SQLite(), | |
"~/Library/Containers/com.apple.iBooksX/Data/Documents/BKLibrary/BKLibrary-1-091020131601.sqlite", | |
synchronous = NULL) | |
df <- | |
tibble::as_tibble(dbReadTable(con, 'ZBKLIBRARYASSET')) |> | |
apple_book_name_fix() |> | |
dplyr::filter(!is.na(title)) | |
DBI::dbDisconnect(con) | |
df | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment