handle multiple albums

This commit is contained in:
λmolinae 2025-05-03 22:38:18 -06:00
parent 9e5d3c9bcf
commit 6b7a348c3b

View file

@ -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