Upload folder to imageshack.us (forum)

imageshack() { for files in *; do curl -H Expect: -F fileupload="@$files" -F xml=yes -# "http://www.imageshack.us/index.php" | grep image_link | sed -e 's/<image_link>/[IMG]/g' -e 's/<\/image_link>/[\/IMG]/g'; done; }
Each file in the current folder is uploaded to imageshack.us If the folder contains other filetypes change: for files in * to: for files in *.jpg (to upload ONLY .jpg files) Additionally you can try (results may vary): for files in *.jpg *.png The output URL is encased with BB image tags for use in a forum.
Sample Output
[user@host ~]$ imageshack
######################################################################## 100.0%
    [IMG]http://img541.imageshack.us/img541/5382/wifidock01.png[/IMG]
######################################################################## 100.0%
    [IMG]http://img716.imageshack.us/img716/54/wifidock02.png[/IMG]
######################################################################## 100.0%
    [IMG]http://img825.imageshack.us/img825/6664/wifidock03.jpg[/IMG]

4
2010-10-01 06:50:04

These Might Interest You

  • If you have a folder with thousand of files and want to have many folder with only 100 file per folder, run this. It will create 0/,1/ etc and put 100 file inside each one. But find will return true even if it don't find anything ... Show Sample Output


    -1
    folder=0;mkdir $folder; while find -maxdepth 1 -type f -exec mv "{}" $folder \; -quit ; do if [ $( ls $folder | wc -l ) -ge 100 ]; then folder=$(( $folder + 1 )); mkdir $folder; fi ; done
    Juluan · 2011-02-11 21:28:01 0
  • Take a screenshot, give $1 seconds pause to choose what to screenshot, then upload and get URI of post in ompdlr.org Show Sample Output


    0
    scrotit(){ echo "Screenshot in $1 seconds...";scrot -d $1 '%Y%m%d%h.png' -e 'curl -sF file1=@- http://ompldr.org/upload < $f | grep -P -o "(?<=File:).*(http://ompldr.org/.*)\<\/a\>";rm $f'| sed -r 's@.*(http://ompldr.org/\w{1,7}).*@\1@';}
    dzup · 2012-12-03 01:21:19 0
  • Create a .png from output command or whatever, the upload and give URI from ompdlr.org Show Sample Output


    1
    omp(){ $*|convert label:@- png:-|curl -sF file1=@- http://ompldr.org/upload | grep -P -o "(?<=File:).*(http://ompldr.org/.*)\<\/a\>" | sed -r 's@.*(http://ompldr.org/\w{1,7}).*@\1@';}
    dzup · 2012-12-02 19:35:29 1
  • Like i said, i havent test it yet, all becouse my internet its soo slow, if you try and works please share, also be nice to do it using the direct url link. Show Sample Output


    -2
    ompload() { wget -O- - "$1" --quiet|curl -# -F file1=@- http://ompldr.org/upload|awk '/Info:|File:|Thumbnail:|BBCode:/{gsub(/<[^<]*?\/?>/,"");$1=$1;print}';}
    dzup · 2012-10-19 22:54:55 1

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: