public
Description: A Rubygem to give client access to the Howcast.com API.
Homepage: http://tech.howcast.com
Clone URL: git://github.com/howcast/howcast-gem.git
name age message
file .gitignore Wed Aug 19 12:23:06 -0700 2009 make it even easier to update stuff...rake buil... [tuesmerde]
file CHANGELOG Wed Aug 19 12:44:57 -0700 2009 0.4.9 [tuesmerde]
file License.txt Tue Jun 17 13:15:32 -0700 2008 Moving repo to howcast-gem [sudothinker]
file Manifest Wed Aug 19 12:44:57 -0700 2009 0.4.9 [tuesmerde]
file README.markdown Wed Aug 19 12:44:57 -0700 2009 0.4.9 [tuesmerde]
file Rakefile Wed Aug 19 12:44:57 -0700 2009 0.4.9 [tuesmerde]
file howcast.gemspec Wed Aug 19 12:44:57 -0700 2009 0.4.9 [tuesmerde]
directory lib/ Wed Aug 19 10:51:13 -0700 2009 move gem to github, use echoe to clean up confi... [tuesmerde]
directory script/ Wed Aug 19 12:02:19 -0700 2009 add script to test gem build in github; add a f... [tuesmerde]
directory spec/ Mon Jul 27 10:38:25 -0700 2009 Removing guide code, updating doc, bumping up v... [sudothinker]
directory tasks/ Wed Aug 19 12:23:06 -0700 2009 make it even easier to update stuff...rake buil... [tuesmerde]
README.markdown

Howcast API Ruby Wrapper

Copyright (c) 2008 Howcast Media Inc.

Author: Jingshen Jimmy Zhang jimmy@howcast.com

Installing

sudo gem install howcast-howcast

Example

require 'rubygems'
require 'howcast'

hc = Howcast::Client.new(:key => "INSERT API KEY HERE")
# Will print out the video titles of the first page of recent howcast studios videos
puts "Recent Howcast Studios Videos"
hc.videos.each do |v|
  puts v.title
end

puts "2nd Page of Top Rated Videos"
# Will print out the video titles of the 2nd page of top rated videos
hc.videos(:page => 2, :sort => "top_rated", :filter => "all").each do |v|
  puts v.title
end

puts "Videos matching 'origami'"
hc.search("origami").each do |v|
  puts v.title
end

puts "Video with id 946"
puts hc.video(946).title

# Category API
piano = hc.category(1105)
puts "The parent category of Piano is #{hc.category(piano.parent_id).name}"

ancestors = piano.parents.map{|c| c[:name]}
# Ancestors will be an array of hash metadata: 
# => [{:name=>"Performing Arts", :id=>"1048"}, 
#     {:name=>"Musical Instruments", :id=>"1095"}, 
#     {:name=>"Keyboards", :id=>"1103"}]
puts "The ancestors of piano are: #{ancestors.join(" -> ")}"