-
-
Save gr33n7007h/84f84ad7dbb289cb4ee4cff627abf07a to your computer and use it in GitHub Desktop.
carc.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> require 'typhoeus' | |
=> true | |
>> require 'json' | |
=> true | |
>> | |
>> url = 'https://carc.in/run_requests' | |
=> "https://carc.in/run_requests" | |
>> code = "p [1,2,3]" | |
=> "p [1,2,3]" | |
>> payload = {run_request: {language: 'ruby', version: "2.4.1", code: code}} | |
=> {:run_request=>{:language=>"ruby", :version=>"2.4.1", :code=>"p [1,2,3]"}} | |
>> headers = {'Content-Type': 'application/json; charset=utf-8'} | |
=> {:"Content-Type"=>"application/json; charset=utf-8"} | |
>> JSOPN.parse Typhoeus.post(url, body: payload.to_json, headers: headers).response_body | |
NameError: (┛ಸ_ಸ)┛ ┻━┻) --> uninitialized constant JSOPN | |
from (pry):7:in `__pry__' | |
>> JSON.parse Typhoeus.post(url, body: payload.to_json, headers: headers).response_body | |
=> {"run_request"=> | |
{"run"=> | |
{"id"=>"5c8n", | |
"language"=>"ruby", | |
"version"=>"2.4.1", | |
"code"=>"p [1,2,3]", | |
"stdout"=>"[1, 2, 3]\n", | |
"stderr"=>"", | |
"exit_code"=>0, | |
"created_at"=>"2018-10-25T20:33:57Z", | |
"url"=>"https://carc.in/runs/5c8n", | |
"html_url"=>"https://carc.in/#/r/5c8n", | |
"download_url"=>"https://carc.in/runs/5c8n.cr"}}} | |
>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment