Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save guypursey/e46849e9fe158d841622 to your computer and use it in GitHub Desktop.
Add or remove post on Scriptogram, pulling in relevant metadata from a separate file
# Usage: ./ [OPTION]... [FILE]
# Publish FILE to account (grabbing metadata as we go).
# FILE should have no extension.
# Expects metascrp.txt accompanying named file to pull metadata from.
# Expects there two text files in location of script,
# one containing app key for Scriptogram,
# the other containing the user ID.
# -d Delete file.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ "$1" == "-d" ]
echo "Deleting..."
fileparam="-d filename=$"
echo $2
echo "Adding..."
fileparam="-d name=$1"
echo $1
curl \
--data-urlencode app_key@"$DIR/scrpakey.txt" \
--data-urlencode user_id@"$DIR/scrpuser.txt" \
"$fileparam" \
--data-urlencode text="$filedata" \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment