Skip to content
Wrapper for grabbio video thumbnail generator.
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
spec
.gitignore
Gemfile test Apr 7, 2011
Rakefile
grabbio.gemspec
readme.md

readme.md

grabbio gem

The grabbio platform is an API that allows you to generate thumbnails in a variety of styles.

Installation

gem install grabbio

Usage

Basic

In its most basic form, the only required parameters are source, upload_url and your api keys.

grabbio = Grabbio.new(YOUR_API_KEY, YOUR_API_SECRET);
grabbio.grab(SOURCE_URL, UPLOAD_URL)

Advanced

All the parameters in the grabbio documentation are supported and passed through as a parameters hash. Here are a few examples:

320x240 Gif, Capsheet and Individual uploaded to an S3 bucket in developer mode

grabbio = Grabbio.new(YOUR_API_KEY, YOUR_API_SECRET);
grabbio.grab(SOURCE_URL, UPLOAD_URL,    :developer_mode => true,
                                        :gif_framerate => 30,
                                        :thumbnail_styles => "individual,gif,capsheet",
                                        :capsheet_columns => 3,
                                        :width => 320,
                                        :height => 240)

180x240 Capsheet uploaded to FTP with a callback

grabbio = Grabbio.new(YOUR_API_KEY, YOUR_API_SECRET);
grabbio.grab(SOURCE_URL, UPLOAD_URL,    :thumbnail_styles => "capsheet",
                                        :width => 180,
                                        :height => 240,
                                        :callback_url => CALLBACK_URL)

Return

All calls return an object if the request is valid, otherwise a GrabbioError is raised with the error message retured from the site.

The response object looks like: {"video"=> {"callback_url"=>nil, "cost"=>1, "created_at"=>"2011-04-08T12:28:34Z", "developer_mode"=>false, "external_id"=>nil, "filename"=>"CxRcyVX70y", "id"=>311, "number_of_thumbnails"=>1, "scale_mode"=>"pad", "source"=>"http://example.com/video.avi", "source_type"=>"http", "status"=>"pending", "thumbnail_format"=>"jpg", "thumbnail_types"=>"individual", "updated_at"=>"2011-04-08T12:28:34Z", "upload_placeholders"=>true, "upload_type"=>"s3", "requested_thumbnails"=> [{ "thumbnail"=> {"created_at"=>"2011-04-08T12:28:36Z", "filename"=>"CxRcyVX70y_120x90_0.jpg", "height"=>90, "id"=>1165, "order"=>0, "thumbnail_type"=>"individual", "updated_at"=>"2011-04-08T12:28:36Z", "video_id"=>311, "width"=>120} }] } }

Example Thumbnails

Individual

Individual Thumbnail Individual Thumbnail Individual Thumbnail Individual Thumbnail Individual Thumbnail Individual Thumbnail

Gif

GIF

Capsheet

Capsheet Example

Something went wrong with that request. Please try again.