Skip to content

Instantly share code, notes, and snippets.

@sneal
Created April 6, 2020 23:56
Show Gist options
  • Save sneal/ac105e0c783a2bb61ae7a36934ece56f to your computer and use it in GitHub Desktop.
Save sneal/ac105e0c783a2bb61ae7a36934ece56f to your computer and use it in GitHub Desktop.
Create Fugacious Secret with Curl
readonly FUGACIOUS_URL='https://fugacio.us/m'
readonly FUGACIOUS_MAX_VIEWS=3
readonly FUGACIOUS_HOURS='2'
createFugaciousSecret() {
local user_password="${1}"
response=$(curl \
--silent \
--request POST \
--output /dev/null \
--write-out %{redirect_url} \
--header "Content-Type: application/json" \
--data "{\"message\":{ \"hours\": \"$FUGACIOUS_HOURS\", \"max_views\": $FUGACIOUS_MAX_VIEWS, \"body\": \"$user_password\" } }" \
"$FUGACIOUS_URL")
echo "$response"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment