Coder Social home page Coder Social logo

howcast-gem's Introduction

Howcast API Ruby Wrapper

Copyright (c) 2008 - 2011 Howcast Media Inc.

Installing

$ sudo gem install howcast

Examples

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(" -> ")}"

Setup for Development Work

get it

$ git clone git://github.com/howcast/howcast-gem.git

install dependencies

$ cd howcast-gem $ bundle install

run tests

$ bundle exec rake spec

see useful rake tasks

$ bundle exec rake -T

start hacking

$ mate .

Releasing

make sure all specs are passing

$ bundle exec rake spec

update/set the release version, where X.X.X is the new version number

$ echo "X.X.X" > VERSION

commit and push the new version (and any other uncommitted files)

$ git commit -a -m 'Blah-blah-blah' $ git push

create tag, build, and push howcast gem to rubygems

$ bundle rake release

howcast-gem's People

Contributors

jurisgalang avatar russhc avatar sudothinker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.