Command line script to upload images to imagebint
November 8, 2010 at 11:02 pm 4 comments
This is quite like the pastebinit command but works for images. Place in your bin folder.
#! /bin/bash
# imagebin - upload images to the internet
# imagebin test.jpg -> url
if [ -n "$1" ]; then
filename="$1"
else
filename=$(tempfile);
cat > $filename;
fi;
curl -s --form "nickname=$(hostname)" --form \
"image=@$filename;type=$(file --brief -L --mime-type $filename)"\
--form "disclaimer_agree=Y" --form "mode=add" --form "Submit=Submit"\
http://imagebin.org/index.php -w '%{redirect_url}\n'
Advertisements
Entry filed under: Uncategorized.
1.
cousteau | April 6, 2012 at 2:14 am
Please remove that ugly -D-|grep|sed and just use -w ‘%{redirect_url}’
Also, instead of cut you can just use the -b option on file.
And thanks for the script, I found it to be pretty useful! 😀
2.
Anon | April 6, 2012 at 10:44 am
Thanks! These seem like good tweaks, I’ve made them.
3.
Matias | June 17, 2013 at 3:44 pm
Niiice script
Replace $(hostname) with $(whoami) to use your username and not your machine name 😉
4.
Ymous | July 10, 2013 at 10:21 pm
Add a pipe to sed’s substitute to link directly to the image.
| sed s/org\\//org\\/”index\.php\?mode\=image\\&id=”/