– ruby-imagebam

ruby-imagebam provides a module to easily upload your images to ImageBam via their API.

You need both a user and developer key from www.imagebam.com/nav/API after you have created an account.

– Usage

# Uploading a single file ib = ImageBam::Upload::Image.new(:file_path => ‘/path/to/my/picture.jpg’,

:content_type => 0, # 0 = safe for work, 1 = not safe for work
:api_key_dev => 'your-dev-key',
:api_key_user => 'your-user-key',
:api_user_secret => 'your-user-secret',
:api_dev_secret => 'your-dev-secret')

response = ib.upload!

puts response

# Uploading multiple files ib = ImageBam::Upload::Image.new(:file_path => [‘/path/to/my/picture.jpg’, ‘/path/to/my/picture2.jpg’],

:content_type => 0, # 0 = safe for work, 1 = not safe for work
:api_key_dev => 'your-dev-key',
:api_key_user => 'your-user-key',
:api_user_secret => 'your-user-secret',
:api_dev_secret => 'your-dev-secret')

responses = ib.upload!

responses.each do |response|

puts response[:url]

end

– Notes

The response is a hash. See lib/response.rb for the keys you have access to.
You can upload multiple files at once (using threads) if you set allow_concurrent_uploads to true