Skip to content

Instantly share code, notes, and snippets.

@antdking
Last active December 23, 2015 00:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save antdking/6556473 to your computer and use it in GitHub Desktop.
Save antdking/6556473 to your computer and use it in GitHub Desktop.
hb_upload() {
content="$*"
key=$(curl -sd post_data="${content}" "http://hastebin.com/documents" | sed 's/{\|}\|\"\|:\|\(key\)//g')
echo "${key}"
}
hb_raw() {
content="$*"
key=$(hb_upload "${content}")
echo "http://hastebin.com/raw/${key}"
}
hb() {
content="$*"
key=$(hb_upload "${content}")
echo "http://hastebin.com/${key}"
}
key=$(curl -d post_data="hello" "http://hastebin.com/documents" | sed 's/{\|}\|\"\|:\|\(key\)//g')
raw_url="http://hastebin.com/raw/${key}"
txt_url="http://hastebin.com/${key}.txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment