Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

animoto/animoto_quickstart_upload_client-ruby

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Animoto Quickstart Upload Client - Ruby

About

This is a small Ruby client (gem) to communicate with the Animoto Quickstart Upload API.

Requirements

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

Usage

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.

Uploading

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

More Information

To learn more about the Animoto affiliate program:

animoto.com/affiliates

Version History

0.0.2 - Client ID is deprecated, content_header is support for application/octet-stream header 0.0.1 - Initial version, minimum requirements.

About

Animoto Quickstart Upload Client

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published