paritybit.ca

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit f82512090d20990c254baae5f59a5625379ebc7d
parent a6d3daa409e6ec4a52e5c6a5870dcfbc418f5ee1
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Tue,  4 Aug 2020 17:45:10 -0400

Add temporary workaround for auto-post

Diffstat:
Mpublish | 36+++++++++++++++++++++---------------
1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/publish b/publish @@ -182,13 +182,15 @@ auto_upload() } # Post a status update on Mastodon linking to the new blog post +# Temporarily just print the status for copying while I figure out how to do +# this with Pleroma auto_post() { if [ "$autoPost" != "true" ]; then return 0 fi - print_info_msg "Posting about it on Mastodon" + print_info_msg "Generating social media post" accessToken="" meta="$(head -n3 "$file" | tail -n1 \ | cut -d'#' -f2 | sed -e 's/^[[:space:]]*//')" @@ -196,20 +198,24 @@ auto_post() "$pageTitle" "$baseURL" "$fileName" "$meta" > /tmp/status.txt uniqueId="$(md5sum /tmp/status.txt | awk '{print $1}')" - resp="$(curl -s -S -i -X POST \ - -H "Idempotency-Key: $uniqueId" \ - -H "Authorization: Bearer $accessToken" \ - -F status="$(cat /tmp/status.txt)" \ - -F visibility=public \ - https://social.paritybit.ca/api/v1/statuses)" - httpCode="$(echo "$resp" | grep HTTP/ | awk '{print $2}')" - - if [ "$httpCode" = "200" ]; then - print_success_msg "Successfully posted status update" - else - print_error_msg "ERROR: Failed to post status update" - echo "$resp" - fi + echo "" + cat /tmp/status.txt + echo "" + + # resp="$(curl -s -S -i -X POST \ + # -H "Idempotency-Key: $uniqueId" \ + # -H "Authorization: Bearer $accessToken" \ + # -F status="$(cat /tmp/status.txt)" \ + # -F visibility=public \ + # https://social.paritybit.ca/api/v1/statuses)" + # httpCode="$(echo "$resp" | grep HTTP/ | awk '{print $2}')" + + # if [ "$httpCode" = "200" ]; then + # print_success_msg "Successfully posted status update" + # else + # print_error_msg "ERROR: Failed to post status update" + # echo "$resp" + # fi } for file in "$@"; do