gem install openphoto-ruby
To use the library you need to first require 'openphoto-ruby', retrieve your OAuth credentials, then instantiate an instance of the client and start making calls.
require 'rubygems'
require 'openphoto-ruby'
@client = Openphoto::Client.new(@site, @consumer_key, @consumer_secret, @access_token, @access_token_secret)
photo = @client.connect(:post, "/photo/upload.json", {"photo"=>"/tmp/photo.png", "permission"=>"1", "title"=>"test upload"})
puts "#{photo.message} #{@site}/photo/#{photo.result["id"]}/view"
You can get your credentials by clicking on the arrow next to your email address once you're logged into your site and then clicking on settings.
If you don't have any credentials then you can create one for yourself by going to /v1/oauth/flow
.
Once completed go back to the settings page and you should see the credential you just created
You can find more information at the main OpenPhoto documentation page.