Yahoo! Video

A Ruby object-oriented interface to the video content available on Yahoo! Video at video.yahoo.com.

The RubyForge project is at rubyforge.org/projects/yahoo-video.

About

This library builds on top of the Yahoo! Video REST API as documented at developer.yahoo.com/search/video/V1/videoSearch.html. All of the relevant Yahoo! Video search parameters are supported.

See also the YouTube and Google Video Ruby libraries.

Installing

We recommend installing yahoo-video via rubygems (see also www.rubygems.org).

Once you have rubygems installed on your system, you can easily install the yahoo-video gem by executing:

% gem install --include-dependencies yahoo-video

Usage

You will need an application id from Yahoo to make use of the service. Ids can be obtained from Yahoo’s registration page at api.search.yahoo.com/webservices/register_application.

Instantiate a YahooVideo::Client, create and configure a YahooVideo::SearchRequest record, and use YahooVideo::Client#search to make requests of the Yahoo! Video server. See method and record documentation for links and more information.

An example program showing a simple script to run queries via the command-line follows. The script is available in the distribution under examples/example.rb.

#!/usr/bin/env ruby

require 'pp'
require 'rubygems'
require 'yahoo-video'

# your application id for use with the yahoo search services.  you can
# get one at http://api.search.yahoo.com/webservices/register_application.
APP_ID = YOUR_APP_ID_HERE

query = ARGV[0]
print "Running a video search for '#{query}'...\n"

client = YahooVideo::Client.new APP_ID
request = YahooVideo::SearchRequest.new :query => query
response = client.search request

pp(response)

License

This library is provided via the GNU LGPL license at www.gnu.org/licenses/lgpl.html.

Authors

Copyright 2006, Walter Korman <[email protected]>, www.lemurware.com.