Skip to content

Instantly share code, notes, and snippets.

@rubenfonseca
Created January 28, 2011 12:19
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 rubenfonseca/800182 to your computer and use it in GitHub Desktop.
Save rubenfonseca/800182 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'oauth'
consumer = OAuth::Consumer.new 'ds1UTK4sT3R5MVhYIYV6w', 'RtqyirueGdzUt0tpbuuYnZAxUv71E3xrxxpfnkxt4', { :site => 'http://hireme.goplanapp.com' }
request = consumer.get_request_token
puts request.authorize_url
sleep 20 # give us time to authenticate
access = request.get_access_token
# create a document on project 'hireme' (project exists)
puts access.post('http://hireme.goplanapp.com/hireme/api/documents/create', {
"file['title']" => 'hosts',
"file['uploaded_data']" => IO.read('/etc/hosts')
}).inspect
# #<Net::HTTPForbidden 403 Forbidden readbody=true>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment