From 0d93102765d9d66d8464976b993948b9a535feef Mon Sep 17 00:00:00 2001 From: "Simon V. Lejel" Date: Mon, 18 Sep 2023 17:42:00 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=EF=B8=8F=20Parse=20the=20reponse?= =?UTF-8?q?=20from=20the=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bing-download.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bing-download.sh b/bing-download.sh index 24ca4df..8cba824 100644 --- a/bing-download.sh +++ b/bing-download.sh @@ -3,3 +3,10 @@ # Get the JSON file, pull out just the URLs and put them in an array images=$(wget -qO- https://peapix.com/bing/feed?country=gb) +# Get URL for download +latest_image_url=$(echo $images | jq '.[0].imageUrl' | tr -d '"') + +# Get metadata for the watermark +latest_image_title=$(echo $images | jq '.[0].title' | tr -d '"') +latest_image_copyright=$(echo $images | jq '.[0].copyright' | tr -d '"') +