From 93253ee5a14618839eead5d90772a945f18c124b Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Thu, 1 Jun 2023 05:28:07 +0200 Subject: [PATCH] Adds the new API endpoint --- src/chapter.sh | 4 ++-- src/name.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chapter.sh b/src/chapter.sh index 277f495..bbc155d 100755 --- a/src/chapter.sh +++ b/src/chapter.sh @@ -67,7 +67,7 @@ if [[ "$BOOK_NAME" =~ $re ]]; then BOOK_NR="${BOOK_NAME}" else # get the list of books from the API to get the book number - BOOKS=$(curl -s "https://getbible.net/v2/${VERSION}/books.json") + BOOKS=$(curl -s "https://api.getbible.net/v2/${VERSION}/books.json") BOOK_NR=$(echo "$BOOKS" | jq -r ".[] | select(.name == \"${BOOK_NAME}\") | .nr") fi # get chapter and verses numbers @@ -77,7 +77,7 @@ CHAPTER_NR=$(echo "${NUMBERS%:*}" | xargs echo -n) # get verses numbers VERSES_NR=$(echo "${NUMBERS#*:}" | xargs echo -n) # get chapter text from getBible API -CHAPTER=$(curl -s "https://getbible.net/v2/${VERSION}/${BOOK_NR}/${CHAPTER_NR}.json") +CHAPTER=$(curl -s "https://api.getbible.net/v2/${VERSION}/${BOOK_NR}/${CHAPTER_NR}.json") # read verses into array by comma separator IFS=',' read -ra VERSES_NR_ARRAY <<<"${VERSES_NR}" # start the scripture array diff --git a/src/name.sh b/src/name.sh index 5bbe920..eaf6bba 100755 --- a/src/name.sh +++ b/src/name.sh @@ -64,7 +64,7 @@ BOOK_NAME=$(echo "${BOOK_NAME%%[0-9]:*}" | xargs echo -n) re='^[0-9]+$' if [[ "$BOOK_NAME" =~ $re ]]; then # get the list of books from the API to get the book number - BOOKS=$(curl -s "https://getbible.net/v2/${VERSION}/books.json") + BOOKS=$(curl -s "https://api.getbible.net/v2/${VERSION}/books.json") BOOK_FULL_NAME=$(echo "$BOOKS" | jq -r ".[] | select(.nr == ${BOOK_NAME}) | .name") # get chapter and verses numbers NUMBERS=$(echo "${SCRIPTURE/$BOOK_NAME/}" | xargs echo -n)