panda 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +67 -70
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/panda.rb +1 -5
- data/lib/panda/panda.rb +3 -1
- data/panda.gemspec +3 -3
- metadata +3 -3
data/README.md
CHANGED
@@ -4,90 +4,87 @@ Panda gem provides an interface to access the [Panda](http://api.pandastream.com
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
sudo gem install panda -s http://gemcutter.org
|
7
|
+
sudo gem install panda -s http://gemcutter.org
|
8
8
|
|
9
9
|
## How to use it
|
10
10
|
|
11
|
-
|
12
|
-
require 'panda'
|
13
|
-
|
11
|
+
require 'panda'
|
14
12
|
|
15
13
|
### Connecting to Panda
|
16
14
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
15
|
+
Panda.connect!({
|
16
|
+
:cloud_id => 'cloud_id',
|
17
|
+
:access_key => 'access_key',
|
18
|
+
:secret_key => 'secret_key',
|
19
|
+
:api_host => 'api.pandastream.com'
|
20
|
+
})
|
23
21
|
|
24
22
|
### Posting a video
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
23
|
+
|
24
|
+
Panda.post('/videos.json', {:source_url => 'http://www.example.com/original_video.mp4'})
|
25
|
+
=>{"duration"=>nil,
|
26
|
+
"created_at"=>"2010/01/15 14:48:42 +0000",
|
27
|
+
"original_filename"=>"panda.mp4",
|
28
|
+
"updated_at"=>"2010/01/15 14:48:42 +0000",
|
29
|
+
"source_url"=>"http://www.example.com/original_video.mp4",
|
30
|
+
"id"=>"12fce296-01e5-11df-ae37-12313902cc92",
|
31
|
+
"extname"=>".mp4",
|
32
|
+
"thumbnail_position"=>nil,
|
33
|
+
"audio_codec"=>nil,
|
34
|
+
"height"=>nil,
|
35
|
+
"upload_redirect_url"=>nil,
|
36
|
+
"fps"=>nil,
|
37
|
+
"video_codec"=>nil,
|
38
|
+
"status"=>"processing",
|
39
|
+
"width"=>nil}
|
40
|
+
|
43
41
|
### Getting all videos
|
44
42
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
### Getting video encodings
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
43
|
+
Panda.get('/videos.json')
|
44
|
+
=> [{"duration"=>14010,
|
45
|
+
"created_at"=>"2010/01/13 16:45:29 +0000",
|
46
|
+
"original_filename"=>"panda.mp4",
|
47
|
+
"updated_at"=>"2010/01/13 16:45:35 +0000",
|
48
|
+
"source_url"=>"http://www.example.com/original_video.mp4",
|
49
|
+
"id"=>"0ee6b656-0063-11df-a433-1231390041c1",
|
50
|
+
"extname"=>".mp4",
|
51
|
+
"thumbnail_position"=>nil,
|
52
|
+
"audio_codec"=>"aac",
|
53
|
+
"height"=>240,
|
54
|
+
"upload_redirect_url"=>nil,
|
55
|
+
"fps"=>29,
|
56
|
+
"video_codec"=>"h264",
|
57
|
+
"status"=>"success",
|
58
|
+
"width"=>300}]
|
59
|
+
|
60
|
+
### Getting video encodings
|
61
|
+
|
62
|
+
Panda.get('/videos/0ee6b656-0063-11df-a433-1231390041c1/encodings.json')
|
63
|
+
=> [{"encoder_id"=>nil,
|
64
|
+
"created_at"=>"2010/01/13 16:45:30 +0000",
|
65
|
+
"video_id"=>"0ee6b656-0063-11df-a433-1231390041c1",
|
66
|
+
"video_url"=>
|
67
|
+
"http://s3.amazonaws.com/panda-videos/0f815986-0063-11df-a433-1231390041c1.flv",
|
68
|
+
"started_encoding_at"=>"2010/01/13 16:47:35 +0000",
|
69
|
+
"updated_at"=>"2010/01/13 16:47:40 +0000",
|
70
|
+
"lock_version"=>7,
|
71
|
+
"extname"=>".flv",
|
72
|
+
"encoding_progress"=>87,
|
73
|
+
"encoding_time"=>3,
|
74
|
+
"id"=>"0f815986-0063-11df-a433-1231390041c1",
|
75
|
+
"height"=>240,
|
76
|
+
"status"=>"success",
|
77
|
+
"profile_id"=>"00182830-0063-11df-8c8a-1231390041c1",
|
78
|
+
"width"=>300}]
|
79
|
+
|
82
80
|
### Deleting a video encoding
|
83
81
|
|
84
|
-
|
82
|
+
Panda.delete('/encodings/0f815986-0063-11df-a433-1231390041c1.json')
|
85
83
|
|
86
84
|
### Deleting a video
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
85
|
+
|
86
|
+
Panda.delete('/videos/0ee6b656-0063-11df-a433-1231390041c1.json')
|
87
|
+
|
91
88
|
Copyright
|
92
89
|
---------
|
93
90
|
|
data/Rakefile
CHANGED
@@ -7,7 +7,7 @@ begin
|
|
7
7
|
gem.name = "panda"
|
8
8
|
gem.summary = %Q{Panda Client}
|
9
9
|
gem.description = %Q{Panda Client}
|
10
|
-
gem.email = "
|
10
|
+
gem.email = "info@pandastream.com"
|
11
11
|
gem.homepage = "http://github.com/newbamboo/panda_gem"
|
12
12
|
gem.authors = ["New Bamboo"]
|
13
13
|
gem.add_development_dependency "rspec", ">= 1.2.9"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/lib/panda.rb
CHANGED
data/lib/panda/panda.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'restclient'
|
2
|
+
|
1
3
|
module Panda
|
2
4
|
class << self
|
3
5
|
|
@@ -40,7 +42,7 @@ module Panda
|
|
40
42
|
auth_params = {}
|
41
43
|
auth_params['cloud_id'] = @cloud_id
|
42
44
|
auth_params['access_key'] = @access_key
|
43
|
-
auth_params['timestamp'] = Time.now.iso8601
|
45
|
+
auth_params['timestamp'] = Time.now.iso8601(6)
|
44
46
|
auth_params['signature'] = ApiAuthentication.authenticate(verb, request_uri, @api_host, @secret_key, params.merge(auth_params))
|
45
47
|
return auth_params
|
46
48
|
end
|
data/panda.gemspec
CHANGED
@@ -5,13 +5,13 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{panda}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["New Bamboo"]
|
12
|
-
s.date = %q{2010-01-
|
12
|
+
s.date = %q{2010-01-26}
|
13
13
|
s.description = %q{Panda Client}
|
14
|
-
s.email = %q{
|
14
|
+
s.email = %q{info@pandastream.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
17
|
"README.md"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: panda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- New Bamboo
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-26 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -63,7 +63,7 @@ dependencies:
|
|
63
63
|
version: "1.2"
|
64
64
|
version:
|
65
65
|
description: Panda Client
|
66
|
-
email:
|
66
|
+
email: info@pandastream.com
|
67
67
|
executables: []
|
68
68
|
|
69
69
|
extensions: []
|