You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
461 B

user=
pass=
instance=
echo "post: "
read post
echo "attachment: "
read at
path=$(echo $at | sed 's/.*/\"&\"/')
if [ "$(echo "\n")" != "$at" ]; then
i=$(curl -X POST -F file=@"$path" --user $user:"$pass" https://"$instance"/api/v1/media | cut -d\" -f10)
curl -X POST -d media_ids[]="$i" -d status="$post" --user $user:"$pass" https://"$instance"/api/v1/statuses
else
curl -X POST -d status="$post" --user $user:"$pass" https://"$instance"/api/v1/statuses
fi