Borwshot is available on Rubygems.
The source code is available on gitbub.
#!/usr/bin/env ruby
require 'browshot'
client = Browshot.new('my_key')
version = client.api_version()
puts "API version : #{version}\n\n"
screenshot = client.screenshot_create('http://www.google.fr/', { 'instance_id' => 12 })
[...]
info = @browshot.screenshot_info(screenshot['id'])
if (info['status'] == 'finished')
thumbnail = client.screenshot_thumbnail(screenshot['id'], { 'width' => 480 })
end
[..]
screenshot = client.screenshot_create('http://www.google.de/', { 'cache' => 0, 'delay' => 10 });
#!/usr/bin/env ruby
require 'browshot'
client = Browshot.new('my_key')
data = client.simple_file('/tmp/myfile.png', {'url' => 'http://mobilito.net/', 'instance_id' => 12})
if (data[:code].to_i == 200)
puts "Screenshot finished"
end