Skip to main content

This script has now moved to my book tracker

ID
410d73d
date
2024-05-12 08:44:02+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
a590a79
message
This script has now moved to my book tracker
changed files
1 file, 33 deletions

Changed files

images/download_cover_image (845) → images/download_cover_image (0)

diff --git a/images/download_cover_image b/images/download_cover_image
deleted file mode 100755
index 5bcc37d..0000000
--- a/images/download_cover_image
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env bash
-# Copy an image from my open browser tab into my book tracker.
-#
-# This is very specific to my setup and unlikely to be useful to anyone else.
-
-set -o errexit
-set -o nounset
-
-LATEST_REVIEW=$(git ls-files -o --exclude-standard)
-
-if [[ "$LATEST_REVIEW" = "" ]]
-then
-  echo "Please create the review file before you copy the cover image!" >&2
-  exit 1
-fi
-
-echo "$LATEST_REVIEW"
-
-filename=$(basename -- "$LATEST_REVIEW" .md)
-year=$(basename -- $(dirname -- "$LATEST_REVIEW"))
-
-url=$(osascript -e 'tell application "Safari" to get URL of document 1')
-
-image_filename=$(basename -- "$url")
-image_extension="${image_filename##*.}"
-
-image_path=~/repos/books.alexwlchan.net/src/covers/$year/$filename.$image_extension
-
-mkdir -p "$(dirname "$image_path")"
-
-echo "$image_path"
-curl "$url" > "$image_path"
-dominant_colours "$image_path"