From 6b7a348c3b6ec0dfe24bd72096d7e92d4eb435b6 Mon Sep 17 00:00:00 2001 From: amolinae06 Date: Sat, 3 May 2025 22:38:18 -0600 Subject: [PATCH] handle multiple albums --- webhook | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/webhook b/webhook index 9513f02..ea42f97 100644 --- a/webhook +++ b/webhook @@ -32,8 +32,7 @@ if [ -z "$data" ]; then exit 0 fi -albumtitle="$(echo "$data" | sed -n '1p')" -albumurl="$(echo "$data" | sed -n '2p')" -albumcover="$(echo "$data" | sed -n '3p')" - -curl -H "Content-Type: application/json" -X POST -d "$(generate_post_data)" $discord_url +echo "$data" | paste -d '\t' - - - | while IFS=$'\t' read -r albumtitle albumurl albumcover; do + payload=$(generate_post_data "$albumtitle" "$albumurl" "$albumcover") + curl -H "Content-Type: application/json" -X POST -d "$payload" "$discord_url" +done