grabbio 0.0.3 → 0.0.4
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/lib/grabbio/client.rb +0 -1
- data/lib/grabbio/utils.rb +0 -1
- data/lib/grabbio/version.rb +1 -1
- data/readme.md +98 -0
- metadata +3 -2
data/lib/grabbio/client.rb
CHANGED
data/lib/grabbio/utils.rb
CHANGED
data/lib/grabbio/version.rb
CHANGED
data/readme.md
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
grabbio gem
|
2
|
+
==============
|
3
|
+
The [grabbio platform](http://grabb.io) is an API that allows you to generate
|
4
|
+
thumbnails in a variety of styles.
|
5
|
+
|
6
|
+
Installation
|
7
|
+
------------
|
8
|
+
|
9
|
+
gem install grabbio
|
10
|
+
|
11
|
+
Usage
|
12
|
+
-----
|
13
|
+
|
14
|
+
###Basic
|
15
|
+
|
16
|
+
In its most basic form, the only required parameters are source, upload_url and
|
17
|
+
your api keys.
|
18
|
+
|
19
|
+
grabbio = Grabbio.new(YOUR_API_KEY, YOUR_API_SECRET);
|
20
|
+
grabbio.grab(SOURCE_URL, UPLOAD_URL)
|
21
|
+
|
22
|
+
###Advanced
|
23
|
+
|
24
|
+
All the parameters in the [grabbio documentation](http://grabb.io/documentation)
|
25
|
+
are supported and passed through as a parameters hash. Here are a few examples:
|
26
|
+
|
27
|
+
####320x240 Gif, Capsheet and Individual uploaded to an S3 bucket in developer mode
|
28
|
+
grabbio = Grabbio.new(YOUR_API_KEY, YOUR_API_SECRET);
|
29
|
+
grabbio.grab(SOURCE_URL, UPLOAD_URL, :developer_mode => true,
|
30
|
+
:gif_framerate => 30,
|
31
|
+
:thumbnail_styles => "individual,gif,capsheet",
|
32
|
+
:capsheet_columns => 3,
|
33
|
+
:width => 320,
|
34
|
+
:height => 240)
|
35
|
+
|
36
|
+
####180x240 Capsheet uploaded to FTP with a callback
|
37
|
+
grabbio = Grabbio.new(YOUR_API_KEY, YOUR_API_SECRET);
|
38
|
+
grabbio.grab(SOURCE_URL, UPLOAD_URL, :thumbnail_styles => "capsheet",
|
39
|
+
:width => 180,
|
40
|
+
:height => 240,
|
41
|
+
:callback_url => CALLBACK_URL)
|
42
|
+
|
43
|
+
####Return
|
44
|
+
All calls return an object if the request is valid, otherwise a GrabbioError is raised
|
45
|
+
with the error message retured from the site.
|
46
|
+
|
47
|
+
The response object looks like:
|
48
|
+
{"video"=>
|
49
|
+
{"callback_url"=>nil,
|
50
|
+
"cost"=>1,
|
51
|
+
"created_at"=>"2011-04-08T12:28:34Z",
|
52
|
+
"developer_mode"=>false,
|
53
|
+
"external_id"=>nil,
|
54
|
+
"filename"=>"CxRcyVX70y",
|
55
|
+
"id"=>311,
|
56
|
+
"number_of_thumbnails"=>1,
|
57
|
+
"scale_mode"=>"pad",
|
58
|
+
"source"=>"http://example.com/video.avi",
|
59
|
+
"source_type"=>"http",
|
60
|
+
"status"=>"pending",
|
61
|
+
"thumbnail_format"=>"jpg",
|
62
|
+
"thumbnail_types"=>"individual",
|
63
|
+
"updated_at"=>"2011-04-08T12:28:34Z",
|
64
|
+
"upload_placeholders"=>true,
|
65
|
+
"upload_type"=>"s3",
|
66
|
+
"requested_thumbnails"=>
|
67
|
+
[{
|
68
|
+
"thumbnail"=>
|
69
|
+
{"created_at"=>"2011-04-08T12:28:36Z",
|
70
|
+
"filename"=>"CxRcyVX70y_120x90_0.jpg",
|
71
|
+
"height"=>90, "id"=>1165,
|
72
|
+
"order"=>0,
|
73
|
+
"thumbnail_type"=>"individual",
|
74
|
+
"updated_at"=>"2011-04-08T12:28:36Z",
|
75
|
+
"video_id"=>311,
|
76
|
+
"width"=>120}
|
77
|
+
}]
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
Example Thumbnails
|
84
|
+
------------------
|
85
|
+
###Individual
|
86
|
+

|
87
|
+

|
88
|
+

|
89
|
+

|
90
|
+

|
91
|
+

|
92
|
+
|
93
|
+
###Gif
|
94
|
+

|
95
|
+
|
96
|
+
###Capsheet
|
97
|
+

|
98
|
+
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 4
|
9
|
+
version: 0.0.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Gazler
|
@@ -36,6 +36,7 @@ files:
|
|
36
36
|
- lib/grabbio/client.rb
|
37
37
|
- lib/grabbio/utils.rb
|
38
38
|
- lib/grabbio/version.rb
|
39
|
+
- readme.md
|
39
40
|
has_rdoc: true
|
40
41
|
homepage: http://github.com/Gazler/
|
41
42
|
licenses: []
|