Skip to content

Instantly share code, notes, and snippets.

@timkelty
Created November 17, 2010 18:24
Show Gist options
  • Select an option

  • Save timkelty/703768 to your computer and use it in GitHub Desktop.

Select an option

Save timkelty/703768 to your computer and use it in GitHub Desktop.
load_files
url = URI.parse('http://gist.github.com/api/v1/xml/new')
req = Net::HTTP.post_form(url, data(private_gist))
case req
when Net::HTTPBadRequest
print "Ewww, not your fault, but something bad happened. No gist created."
when Net::HTTPFound
url = copy req['Location']
print "Created gist at #{url}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment