Ruby library for Hey!Watch available

August 8, 2007 – 5:40 pm

Hi people,

The ruby library for Hey!Watch is finally released.
To install it:

gem install heywatch

Here is an example:

require 'heywatch'
include HeyWatch

Base::establish_connection! :login => 'login', :password => 'password'

raw_video = Download.create(
:url => 'http://host.com/video.avi',
:download => true) do |percent, total_size, received|
puts "#{percent}%"
end

ipod_format = Format.find_by_name('iPod 4:3')
encoded_video = Job.create(:video_id => raw_video.id, :format_id => ipod_format.id) do |percent|
puts "#{percent}%"
end

puts "downloading #{encoded_video.title}"
path = encoded_video.download
puts "video saved in #{path}"

You can find the doc here.

Post a Comment