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.

Using sed for grouping When the actor pattern does not do anything for you

4 Comments Add your own

  • 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! 😀

    Reply
    • 2. Anon  |  April 6, 2012 at 10:44 am

      Thanks! These seem like good tweaks, I’ve made them.

      Reply
  • 3. Matias  |  June 17, 2013 at 3:44 pm

    Niiice script
    Replace $(hostname) with $(whoami) to use your username and not your machine name 😉

    Reply
  • 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=”/

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


November 2010
M T W T F S S
« Oct   Dec »
1234567
891011121314
15161718192021
22232425262728
2930  

%d bloggers like this: