Skip to content

Instantly share code, notes, and snippets.

@trevorturk
Created September 17, 2009 05:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trevorturk/188359 to your computer and use it in GitHub Desktop.
Save trevorturk/188359 to your computer and use it in GitHub Desktop.
# Ruby example for using Pygments via HTTP
require 'net/http'
require 'uri'
lang = 'python'
code = 'print "Hello World"'
request = Net::HTTP.post_form(URI.parse('http://pygments.appspot.com/'), {'lang'=>lang, 'code'=>code})
puts request.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment