Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
111 lines (85 sloc) 3.81 KB


Panda gem provides an interface to access the Panda API from Ruby.


sudo gem install panda -s

How to use it

require 'rubygems'
require 'panda'

Creating an instance of the client

  :cloud_id => 'cloud_id', 
  :access_key => 'access_key', 
  :secret_key => 'secret_key', 
  :api_host => '' # This may change depending on the region

Posting a video'/videos.json', {:file =>"panda.mp4")}) # Note that you will need a movie file to test this. You can grab'/videos.json', {:source_url => ''})
 "created_at"=>"2010/01/15 14:48:42 +0000",
 "updated_at"=>"2010/01/15 14:48:42 +0000",

Getting all videos

=> [{"duration"=>14010,
  "created_at"=>"2010/01/13 16:45:29 +0000",
  "updated_at"=>"2010/01/13 16:45:35 +0000",

Getting video encodings

=> [{"encoder_id"=>nil,
  "created_at"=>"2010/01/13 16:45:30 +0000",
  "started_encoding_at"=>"2010/01/13 16:47:35 +0000",
  "updated_at"=>"2010/01/13 16:47:40 +0000",

Deleting a video encoding


Deleting a video


Generating signatures

All requests to your Panda cloud are signed using HMAC-SHA256, based on a timestamp and your Panda secret key. This is handled transparently. However, sometimes you will want to generate only this signature, in order to make a request by means other than this library. This is the case when using the JavaScript panda_uploader.

To do this, a method signed_params() is supported:

Panda.signed_params('POST', '/videos.json')
# => {'access_key' => '8df50af4-074f-11df-b278-1231350015b1',
# 'cloud_id' => 'your-cloud-id',
# 'signature' => 'LejCdm0O83+jk6/Q5SfGmk14WTO1pB6Sh6Z5eA2w5C0=',
# 'timestamp' => '2010-02-26T15:01:46.221513'}

Panda.signed_params('GET', '/videos.json', {'some_params' => 'some_value'})
# => {'access_key' => '8df50af4-074f-11df-b278-1231350015b1',
#  'cloud_id' => 'your-cloud-id',
#  'signature' => 'uHnGZ+kI9mT3C4vW71Iop9z2N7UKCv38v2l2dvREUIQ=',
#  'some_param' => 'some_value',
#  'timestamp' => '2010-02-26T15:04:27.039620'}


Copyright (c) 2009-2010 New Bamboo. See LICENSE for details.

Jump to Line
Something went wrong with that request. Please try again.