Your task is to create a program or function that creates a paste on sprunge.us. Your program/function must receive the text to sprunge from your language's usual input mechanism, such as standard in; or in the case of a function, it can be a string or whatever makes the most sense to you. Your program will POST the text from input to http://sprunge.us/
as multipart/form-data
with the form field name of sprunge
. Finally, your program will output/return the URL sent back in the reply from the POST.
This is a code golf, so shortest answer (in bytes) wins.
Here is an example solution using bash
and curl
taken directly from the sprunge.us website. Feel free to use it in your own golf:
curl -F 'sprunge=<-' http://sprunge.us
Which returns the URL to the paste, which looks like http://sprunge.us/aXZI
, where the aXZI
is the ID of the sprunge.
This is my first code golfing challenge, please let me know if this is too easy or not creative enough