Skip to content

Instantly share code, notes, and snippets.

@joepie91

joepie91/README.md

Last active Oct 28, 2015
Embed
What would you like to do?
Uploading to curl.io without a browser (but with a progress bar!)

Simply save the script in your home directory (as set-alias.sh or whatever else you want), and add the following to your .bashrc:

source ~/set-alias.sh

Don't forget to use the right filename if you've changed it!

Now you can just use the curlio command:

sven@linux-etoq:~/archive/maagdenhuis_videos> curlio maagdenhuis4.flv 
######################################################################## 100.0%
http://curl.io/get/grlpigul/b0237b039e8e655a5b8c4723282aa9ae56c0e6a1

Note: You'll need to have jq installed for this to work! It's probably shipped by your distribution.

function curlio {
curl --progress-bar -F "file=@$1" "https://curl.io/send/$(curl -s "https://curl.io/socket.io/?EIO=3&transport=polling&t=$(date +%s)-1&sid=$(curl -s "https://curl.io/socket.io/?EIO=3&transport=polling&t=$(date +%s)-0" | grep -oEa "\{.+" | jq -r .sid)" | grep -oEa "\[.+" | jq -r '.[1]')" | grep -oE https://curl.io/get/.+
}
export -f curlio
@dizda

This comment has been minimized.

Copy link

@dizda dizda commented Sep 14, 2015

Wow dude, you've just posted a such nice way to workaround the progressbar & the upload directly from the terminal.
Well done!

@dizda

This comment has been minimized.

Copy link

@dizda dizda commented Sep 14, 2015

Just one thing, the result url is not printed.

➜  Downloads  curlio vpnvision-mac.zip
######################################################################## 100.0%
➜  Downloads
@joepie91

This comment has been minimized.

Copy link
Owner Author

@joepie91 joepie91 commented Sep 19, 2015

I've fixed the script. They seem to have switched to forced HTTPS, so that's what broke it.

It should work again now!

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