Naomi's Book Library
-An interactive explorer for the books Naomi reads.
-Loading library...
-Naomi's Book Library
+This page has moved! You can find Naomi's book library at library.nhcarrigan.com.
+diff --git a/books.sh b/books.sh deleted file mode 100755 index bd5d010..0000000 --- a/books.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# Initialize an empty string to hold the list of books in JSON-like format -books="" -filecount=$(find "/mnt/c/Users/accou/Documents/iDrive/Cloud-Drive_accounts@nhcarrigan.com/Books" -type f | wc -l) -echo "Found $filecount files." -current=0 - -# Loop over each file found by find -while IFS= read -r -d $'\0' file; do - current=$((current + 1)) - echo -ne "Processing $current/$filecount\r" - title=$(exiftool "$file" | grep "^Title\s*:" | cut -d ":" -f 2 | sed -e 's/^[[:space:]]*//') - author=$(exiftool "$file" | grep "^Creator\s*:" | cut -d ":" -f 2 | sed -e 's/^[[:space:]]*//') - - if [ -z "$title" ]; then - # remove extension from the filename - title=$(basename "$file" | sed -e 's/\.[^.]*$//') - fi - if [ -z "$author" ]; then - author=$(exiftool "$file" | grep "^Author\s*:" | cut -d ":" -f 2 | sed -e 's/^[[:space:]]*//') - fi - if [ -z "$author" ]; then - author="Unknown Author" - fi - - # use jq to add the book to the list - books="$books$(jq -n --arg title "$title" --arg author "$author" '{title: $title, author: $author}')," -done < <(find "/mnt/c/Users/accou/Documents/iDrive/Cloud-Drive_accounts@nhcarrigan.com/Books" -type f -print0) - -# Remove trailing comma and add square brackets to complete the list -books="[${books%,}]" - -# Write to ./books/books.json -echo "$books" > ./books/books.json -echo -ne "Done!\r" diff --git a/books/index.html b/books/index.html index 1e5679e..05d8bfc 100644 --- a/books/index.html +++ b/books/index.html @@ -4,114 +4,15 @@
An interactive explorer for the books Naomi reads.
-Loading library...
-This page has moved! You can find Naomi's book library at library.nhcarrigan.com.
+