From 1a690be54320b9f61550c66075b8205cc7db9ca5 Mon Sep 17 00:00:00 2001 From: NaiJi Date: Sat, 16 Apr 2022 00:55:20 +0000 Subject: [PATCH] Cosmetic changes --- post.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/post.sh b/post.sh index a092f64..a7ef9ad 100644 --- a/post.sh +++ b/post.sh @@ -33,7 +33,11 @@ mkdir source cd source wget "${source_url}" 2> /dev/null || (echo "Error with ${source_url}" && exit 1) -media_json=$(curl -X POST "${api_base_url}/api/v1/media" -H "Authorization: Bearer ${access_token}" -F "file=@`ls *`" -F "description=${source_url}") +media_json=$(curl -X POST "${api_base_url}/api/v1/media" \ + -H "Authorization: Bearer ${access_token}"\ + -F "file=@`ls *`" + -F "description=${source_url}") + media_id=$(jq -r ".id" <<< ${media_json}) echo $media_json @@ -41,6 +45,6 @@ cd .. rm -rf source/ curl -X POST -d '{"status":" :azrn_shiratsuyu_maid: '${hyperlink_url}'", "visibility":"'unlisted'", "media_ids":'[\"${media_id}\"]'}' \ - -H "Authorization: Bearer ${access_token}" \ - -H "Content-Type: application/json" \ - "${api_base_url}/api/v1/statuses" + -H "Authorization: Bearer ${access_token}" \ + -H "Content-Type: application/json" \ + "${api_base_url}/api/v1/statuses"