Created
January 28, 2011 12:19
-
-
Save rubenfonseca/800182 to your computer and use it in GitHub Desktop.
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 '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