Simple image host.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pbin 395B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. url="www.pbin.in/upload.php"
  3. if [ "$1" = "" ]; then
  4. echo "pbin <file> [name]"
  5. exit
  6. elif [ ! -s "$1" ]; then
  7. echo "$1: no such file"
  8. exit
  9. fi
  10. content=`cat $1`
  11. name=`curl "$url" -s -F "name=$2" -F "content=$content"`
  12. if [ $? -eq 0 ]; then
  13. echo "http://pbin.in/$name" | xclip
  14. echo "http://pbin.in/$name"
  15. else
  16. echo "There was an error. The file you provided may be too big."
  17. fi