Is it possible to use pastebin (may be via their “API” functionality) inside bash shell scripts? How do I send http-post? How do I get back the URL?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The documentation says that you need to submit a
POSTrequest toand the only mandatory parameter is
paste_code, of type string is the paste that you want to make.On success a new
pastebinURL will be returned.You can easily do this from your bash shell using the command
curl.curluses the-doption to send thePOSTdata to the specified URL.Demo:
This demo will create a new paste with the code:
From your shell:
Now if you see the URL http://pastebin.com/598VLDZp, you’ll see my paste 🙂
Alternatively you can do it using the
wgetcommand which uses the option--post-datato sentPOSTvalues.I’ve tried this command it works fine: