Compare commits

...

2 Commits

Author SHA1 Message Date
Steven Saus 01d77b674a Seems to work! 7 months ago
Steven Saus 41fffb6907 Fixing stuff 7 months ago
  1. 30
      patootie.sh

@ -28,8 +28,8 @@ ANSWER=$(yad --form --separator="±" --item-separator="," --columns=2 --title "p
--item-separator="," --button=Cancel:99 --button=Post:0)
TootText=$(echo "${ANSWER}" | awk -F '±' '{print $1}' | sed -e 's/"/“/g' -e "s/'/’/g" -e 's/—/ -- /g' -e 's/ — / -- /g' -e 's/ - / -- /g' -e 's/ – / -- /g' -e 's/ – / -- /g')
ContentWarning=$(echo "${ANSWER}" | awk -F '±' '{print $2}' | sed -e 's/"/“/g' -e "s/'/’/g" -e 's/—/ -- /g' -e 's/ — / -- /g' -e 's/ - / -- /g' -e 's/ – / -- /g' -e 's/ – / -- /g')
TootText=$(echo "${ANSWER}" | awk -F '±' '{print $1}' | sed -e 's/"/“/g' -e "s/'/’/g" -e 's/ -- /—/g' -e 's/ — /—/g' -e 's/ - /—/g' -e 's/ – /—/g' -e 's/ – /—/g')
ContentWarning=$(echo "${ANSWER}" | awk -F '±' '{print $2}' | sed -e 's/"/“/g' -e "s/'/’/g" -e 's/ -- /—/g' -e 's/(/—/g' -e 's/)/—/g' -e 's/ — /—/g' -e 's/ - /—/g' -e 's/ – /—/g' -e 's/ – /—/g')
if [ "$ContentWarning" == "none" ];then
ContentWarning=""
fi
@ -51,13 +51,18 @@ if [ "${Need_Image}" == "TRUE" ];then
SendImage=$(mktemp --suffix=.${extension})
cp "${IMAGE_FILE}" "${SendImage}"
fi
ALT_TEXT=$(yad --window-icon=musique --on-top --skip-taskbar --image-on-top --borders=5 --title "Choose your alt text" --image "${SendImage}" --form --separator="±" --item-separator="," --text-align=center --field="Alt text to use?:TXT" "I was too lazy to put alt text" --item-separator="," --separator="±")
ALT_TEXT=$(yad --window-icon=musique --on-top --skip-taskbar --image-on-top --borders=5 --title "Choose your alt text" --image "${SendImage}" --form --separator="" --item-separator="," --text-align=center --field="Alt text to use?:TXT" "I was too lazy to put alt text" --item-separator="," --separator="")
echo "$ALT_TEXT"
if [ ! -z "$ALT_TEXT" ];then
AltText=$(echo "${ALT_TEXT}" | sed -e 's/"/“/g' -e "s/'/’/g" -e 's/—/ -- /g' -e 's/ — / -- /g' -e 's/ - / -- /g' -e 's/ – / -- /g' -e 's/ – / -- /g')
# parens changed here because otherwise eval chokes
AltText=$(echo "${ALT_TEXT}" | sed -e 's/"/“/g' -e "s/'/’/g" -e 's/ -- /—/g' -e 's/(/—/g' -e 's/)/—/g' -e 's/ — /—/g' -e 's/ - /—/g' -e 's/ – /—/g' -e 's/ – /—/g')
AltText=" --description \"${AltText}\""
else
AltText=""
fi
echo "$AltText"
# now adding the beginning part to the SendImage string for binary usage
SendImage=" --media ${SendImage}"
fi
fi
@ -67,17 +72,24 @@ if [ ! -z "$ContentWarning" ];then
#if there is an image, and it's a CW'd post, the image should be sensitive
ContentWarning=$(echo "--sensitive -p \"${ContentWarning}\"")
else
ContentWarning=$(echo "-p \"${Content Warning}\"")
ContentWarning=$(echo "-p \"${ContentWarning}\"")
fi
fi
if [ -z "$TOOTACCT" ];then
echo "hi"
postme=$(printf "%s post \"%s\" %s %s --quiet" "$binary" "${TootText}" "${SendImage}" "${ContentWarning}")
eval ${postme}
echo "${postme}"
echo "$postme"
echo ${postme}
#eval "${postme}"
else
postme=$(printf "%s post \"%s\" %s %s -u %s --quiet" "$binary" "${TootText}" "${SendImage}" "${ContentWarning}" "${TOOTACCT}")
eval ${postme}
postme=$(printf "echo -e \"${TootText}\" | %s post %s %s %s -u %s --quiet" "$binary" "${SendImage}" "${AltText}" "${ContentWarning}" "${TOOTACCT}")
echo ${postme}
eval "${postme}"
fi
if [ -f "$SendImage" ];then

Loading…
Cancel
Save