This is a small Ruby client (gem) to communicate with the Animoto Quickstart Upload API.
You must be a registered Animoto affiliate and an authorized client of the Quickstart Upload API. You will need both your affiliate referral code and Upload API secret key.
To run the tests, you will need to add your affiliate referral code and secret key to this file:
test/quickstart_upload_integration_test.rb
You will then be able to run the integration tests with:
rake test
To obtain resource links from the API:
client = Animoto::QuickstartUploadClient.new(AFFILIATE_REFERRAL_CODE, SECRET_KEY) links = client.get_resource_links("jpg", 5)
This will obtain 5 resource urls to upload .jpg files to Animoto.com
To just generate a signature that is used to sign all requests to all API calls to obtain resource URLs:
client = Animoto::QuickstartUploadClient.new(AFFILIATE_REFERRAL_CODE, SECRET_KEY) signature = client.generate_signature(:client_id => 'test', :n => 3, :type => 'gif')
To load the gem from an outside ruby script, you can try the following:
require 'rubygems' gem 'animoto_quickstart_upload_client', :lib => 'quickstart_upload_client'
This should allow you to create the client in your script.
The gem does not perform the upload of your asset to Animoto.com (yet). However, you can verify that the upload URL functions by performing this:
curl -T your_file resource_url
This will simulate an HTTP PUT of your file to Animoto so it can be used in a video project. You might need to place the resource_url in single quotes to escape the special characters from the command line.
For more information on curl:
curl.haxx.se/docs/httpscripting.html
To learn more about the Animoto affiliate program:
0.0.2 - Client ID is deprecated, content_header is support for application/octet-stream header 0.0.1 - Initial version, minimum requirements.