Created
November 27, 2012 13:57
-
-
Save ayosec/4154346 to your computer and use it in GitHub Desktop.
Client for the GitHub Markdown API
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 "json" | |
require "net/https" | |
content = ARGF.read | |
http = Net::HTTP.new("api.github.com", 443).tap do |h| | |
h.use_ssl = true | |
end | |
request = Net::HTTP::Post.new("/markdown") | |
request.body = {text: content, mode: "gfm"}.to_json | |
response = http.request(request) | |
print response.body |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment