Skip to content

Instantly share code, notes, and snippets.

@Voker57
Created October 29, 2009 20:44
Show Gist options
  • Save Voker57/221804 to your computer and use it in GitHub Desktop.
Save Voker57/221804 to your computer and use it in GitHub Desktop.
#!/bin/sh
usage()
{
echo "Usage: dump <file|image|text> [file] [language]"
}
case $1 in
file)
URL=`curl -w %{redirect_url} -F "file=@$2" http://dump.bitcheese.net/upload-file?simple`
echo "$URL [$URL/preview]" ;;
image)
URL=`curl -w %{redirect_url} -F "file=@$2" http://dump.bitcheese.net/upload-image?simple`
echo "$URL [$URL/preview]" ;;
text)
if [ -z $3 ] ; then
LANG=Plaintext
else
LANG=$3
fi
URL=`curl -w %{redirect_url} -F "lang=$LANG" -F "text=@$2" http://dump.bitcheese.net/upload-text`
echo $URL ;;
*) usage;
esac
@Voker57
Copy link
Author

Voker57 commented Sep 28, 2018

@l29ah запили без использования внешних тулз (urlencode), сделаю официальным.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment