This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Konlab's profile picture

Pastebin question

Started by Konlab, 24 June 2014 - 05:05 PM
Konlab #1
Posted 24 June 2014 - 07:05 PM
Hi!
I need some help with http api:
How to post something to pastebin using http API, not shell.run('pastebin put…
Also, main thing is that, if I need to know the pastebin code of uploaded file.

Thanks!
flaghacker #2
Posted 24 June 2014 - 08:56 PM
Try looking at the code of the "pastebin" program.

edit rom/programs/pastebin
Cranium #3
Posted 24 June 2014 - 09:06 PM
I'd also look at the pastebin api. They have a well documented api, and I use it for SmartPaste.
TheOddByte #4
Posted 25 June 2014 - 12:33 AM
Take a look at this, I created it looking through the pastebin program
http://pastebin.com/hbHHH9UX
Konlab #5
Posted 25 June 2014 - 11:35 AM
Thanks for help!
Also can I edit a paste from CC?
theoriginalbit #6
Posted 25 June 2014 - 11:38 AM
They have a well documented api, and I use it for SmartPaste.
well yes and no. last I checked they didn't give a definitive list of errors/problems that can be returned as content. it's very annoying!
Cranium #7
Posted 25 June 2014 - 03:39 PM
well yes and no. last I checked they didn't give a definitive list of errors/problems that can be returned as content. it's very annoying!
Sure it does:
Bad API request, invalid api_option
Bad API request, invalid api_dev_key
Bad API request, IP blocked
Bad API request, maximum number of 25 unlisted pastes for your free account
Bad API request, maximum number of 10 private pastes for your free account
Bad API request, api_paste_code was empty
Bad API request, maximum paste file size exceeded
Bad API request, invalid api_expire_date
Bad API request, invalid api_paste_private
Bad API request, invalid api_paste_format
Edited on 25 June 2014 - 01:40 PM
theoriginalbit #8
Posted 25 June 2014 - 05:16 PM
-snip-
nah there's more than just those though. there's the captcha errors, and max pastes for IPs, and a few others like that. I've had a few on some servers where the pastebin program will say it has worked, and the contents of the file (or the uploaded as code) is the error message.