Created
April 6, 2020 23:56
-
-
Save sneal/ac105e0c783a2bb61ae7a36934ece56f to your computer and use it in GitHub Desktop.
Create Fugacious Secret with Curl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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